[
https://issues.apache.org/jira/browse/SCB-726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16542411#comment-16542411
]
ASF GitHub Bot commented on SCB-726:
------------------------------------
WillemJiang commented on a change in pull request #800: [SCB-726] edge support
convert from form-data or x-www-form-urlencoded to json automatically
URL:
https://github.com/apache/incubator-servicecomb-java-chassis/pull/800#discussion_r202226241
##########
File path:
common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/param/BodyProcessorCreator.java
##########
@@ -70,8 +78,8 @@ public Object getValue(HttpServletRequest request) throws
Exception {
if (isRequired == false && inputStream.available() == 0) {
return null;
}
- String contentType = request.getContentType();
- if (contentType != null &&
!contentType.toLowerCase(Locale.US).startsWith(MediaType.APPLICATION_JSON)) {
+
+ if (!contentType.isEmpty() &&
!contentType.startsWith(MediaType.APPLICATION_JSON)) {
// TODO: we should consider body encoding
return IOUtils.toString(inputStream, "UTF-8");
Review comment:
we may need to check the charset in the content-type for the encoding.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> edge support convert from form-data or x-www-form-urlencoded to json
> automatically
> ----------------------------------------------------------------------------------
>
> Key: SCB-726
> URL: https://issues.apache.org/jira/browse/SCB-726
> Project: Apache ServiceComb
> Issue Type: Task
> Components: Java-Chassis
> Reporter: wujimin
> Assignee: wujimin
> Priority: Major
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)