Closed rvansa closed 1 week ago
I am trying to connect using aws-c-s3 to a localstack instance. On listing objects in a bucket localstack replies with
aws-c-s3
<?xml version='1.0' encoding='utf-8'?> <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01\"> <IsTruncated>false</IsTruncated> <Name>foo</Name> <Prefix /> <MaxKeys>1000</MaxKeys> <EncodingType>url</EncodingType> <KeyCount>1</KeyCount> <Contents> (redacted) </Contents> </ListBucketResult>
but xml_parser is unable to parse empty tag <Prefix />: it ignores that it is an empty tag and looks for </Prefix>, failing to parse the document.
<Prefix />
</Prefix>
Valid XML is parsed.
Parser logs XML document is invalid. and returns error.
XML document is invalid.
Try to parse
<?xml version='1.0' encoding='utf-8'?> <foo><bar /></foo>
No response
v0.9.27
GCC 11.2
Linux
Thanks for finding this bug. We have a PR that should fix this: https://github.com/awslabs/aws-c-common/pull/1168
Describe the bug
I am trying to connect using
aws-c-s3
to a localstack instance. On listing objects in a bucket localstack replies withbut xml_parser is unable to parse empty tag
<Prefix />
: it ignores that it is an empty tag and looks for</Prefix>
, failing to parse the document.Regression Issue
Expected Behavior
Valid XML is parsed.
Current Behavior
Parser logs
XML document is invalid.
and returns error.Reproduction Steps
Try to parse
Possible Solution
No response
Additional Information/Context
No response
aws-c-common version used
v0.9.27
Compiler and version used
GCC 11.2
Operating System and version
Linux