You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/06/04 01:30:55 UTC

[GitHub] WillemJiang commented on a change in pull request #746: [SCB-637] Enhance HttpServletRequestEx impl

WillemJiang commented on a change in pull request #746: [SCB-637] Enhance HttpServletRequestEx impl
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/746#discussion_r192611193
 
 

 ##########
 File path: foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/http/StandardHttpServletRequestEx.java
 ##########
 @@ -79,4 +99,74 @@ public Buffer getBodyBuffer() {
   public int getBodyBytesLength() {
     return bodyBuffer.getBodyBytesLength();
   }
+
+  private Map<String, String[]> parseParameterMap() {
+    // 1.post method already parsed by servlet
+    // 2.not APPLICATION_FORM_URLENCODED, no need to enhance
+    if (getMethod().equalsIgnoreCase(HttpMethod.POST)
+        || !StringUtils.startsWithIgnoreCase(getContentType(), MediaType.APPLICATION_FORM_URLENCODED)) {
+      return super.getParameterMap();
+    }
+
+    Map<String, List<String>> listMap = parseUrlEncodedBody();
 
 Review comment:
   If the content type is not url encoded, we will consume the input stream, and we cannot read the body content again.
   I think the need to check the content type before parse the body.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services