Skip to content

Conversation

liubao68
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 85.308% when pulling 65753cf on liubao68:encoding into b0961b2 on ServiceComb:master.

InputStream inputStream = (InputStream) body;

String contentType = request.getContentType();
if (contentType != null && contentType.startsWith(MediaType.TEXT_PLAIN)) {
Copy link
Member

Choose a reason for hiding this comment

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

You can get the encoding information from the content-type , just like this "Content-Type: text/html; charset=utf-8" .
I don't think using the "UTF-8" without checking the charset is good idea. We can use the default setting as UTF-8, but when user specify the charset, we need to take it in the consideration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I add a TODO to fix this later. But we use a hard code now. Now UTF-8 is the correct one, because most URI encoding use UTF-8 and we use json as body, they are all UTF-8

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@WillemJiang WillemJiang left a comment

Choose a reason for hiding this comment

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

Please check the content type for the encoding.

@WillemJiang WillemJiang merged commit 2cabe72 into apache:master Jul 27, 2017
@WillemJiang WillemJiang modified the milestone: 0.2.0 Aug 19, 2017
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