Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BOM handling in queue responses #309

Merged
merged 4 commits into from
Jun 22, 2021

Conversation

arnodb
Copy link
Contributor

@arnodb arnodb commented Jun 18, 2021

Hi, this PR fixes the BOM handling in queue API responses.

Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than stripping/skipping the BOM from all responses like this, what about just ignoring the BOM in the response itself? JSON is supposed to be UTF-8, and any different encoding should be reflected in the Content-Encoding header. Doing this centrally would be more productive than having to strip/skip it everywhere it's used.

Copy link
Contributor

@ctaggart ctaggart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to convert to a str to strip a UTF-8 BOM. serde_xml_rs can read directly from a byte slice. I created a slice_bom & read_xml functions in impero-com#2 to add to this.

@arnodb
Copy link
Contributor Author

arnodb commented Jun 21, 2021

Thanks, that is entirely right.

@arnodb arnodb requested a review from ctaggart June 21, 2021 14:42
@ctaggart ctaggart merged commit fc795ff into Azure:master Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants