Skip to content

Commit

Permalink
fix(file_info): add workaround for a XML parser issue
Browse files Browse the repository at this point in the history
The XML parser fails to process an `</EDITION >` tag in the file info
response.
  • Loading branch information
nickelc committed Dec 6, 2023
1 parent 4f5ecfe commit d79b88d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/binary_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ pub enum DecryptKey {
}

pub fn from_xml(model: &str, region: &str, xml: &str) -> Result<BinaryInfo, Error> {
let msg = Message::from_str(xml)?;
// Workaround for an issue with the xml parser: UnexpectedEof
let xml = xml.replace("</EDITION >", "</EDITION>");

let msg = Message::from_str(&xml)?;

let binary_name = msg.body.put.binary_name.to_string();
let binary_size = msg.body.put.binary_byte_size.parse()?;
Expand Down

0 comments on commit d79b88d

Please sign in to comment.