Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Conversation

@matthiasblaesing
Copy link
Contributor

The input from the bot is marked as content-type "appliation/json; charset=utf-8"
even if the charset would not be explicitly stated, RFC8259 requires the
encoding to be UTF-8.

The approach to read individual bytes from the inputstream and treat
each byte as a character (ControllerBase.java) or even as url encoded
data (app.java) are just invalid and work by plain luck. If only ascii
input is tested, it most probably mostly works, but fails for all inputs
with high bytes set.

Jackson can decode JSON directly from an inputstream and then does the
right thing, there is no need to manually read the stream.

The input from the bot is marked as content-type "appliation/json; charset=utf-8"
even if the charset would not be explicitly stated, RFC8259 requires the
encoding to be UTF-8.

The approach to read individual bytes from the inputstream and treat
each byte as a character (ControllerBase.java) or even as url encoded
data (app.java) are just invalid and work by plain luck. If only ascii
input is tested, it most probably mostly works, but fails for all inputs
with high bytes set.

Jackson can decode JSON directly from an inputstream and then does the
right thing, there is no need to manually read the stream.
@msftclas
Copy link

msftclas commented Oct 27, 2019

CLA assistant check
All CLA requirements met.

Copy link
Member

@tracyboehrer tracyboehrer left a comment

Choose a reason for hiding this comment

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

@tracyboehrer tracyboehrer merged commit ad8eb63 into microsoft:master Oct 28, 2019
@matthiasblaesing matthiasblaesing deleted the utf8-stream branch October 29, 2019 19:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants