Pil0tXia commented on code in PR #4768:
URL: https://github.com/apache/eventmesh/pull/4768#discussion_r1549250108


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/boot/AbstractHTTPServer.java:
##########
@@ -255,30 +251,9 @@ public void sendResponse(final ChannelHandlerContext ctx, 
final DefaultFullHttpR
      * @param httpRequest
      * @return
      */
-    private Map<String, Object> parseHttpRequestBody(final HttpRequest 
httpRequest) throws IOException {
-        final long bodyDecodeStart = System.currentTimeMillis();
-        final Map<String, Object> httpRequestBody = new HashMap<>();
-
-        if (HttpMethod.GET.equals(httpRequest.method())) {
-            new QueryStringDecoder(httpRequest.uri())
-                .parameters()
-                .forEach((key, value) -> httpRequestBody.put(key, 
value.get(0)));
-        } else if (HttpMethod.POST.equals(httpRequest.method())) {
-            decodeHttpRequestBody(httpRequest, httpRequestBody);
-        }
-        
metrics.getSummaryMetrics().recordDecodeTimeCost(System.currentTimeMillis() - 
bodyDecodeStart);
-        return httpRequestBody;
-    }
-
-    private void decodeHttpRequestBody(HttpRequest httpRequest, Map<String, 
Object> httpRequestBody) throws IOException {
-        final HttpPostRequestDecoder decoder = new 
HttpPostRequestDecoder(DEFAULT_HTTP_DATA_FACTORY, httpRequest);
-        for (final InterfaceHttpData param : decoder.getBodyHttpDatas()) {
-            if (InterfaceHttpData.HttpDataType.Attribute == 
param.getHttpDataType()) {
-                final Attribute data = (Attribute) param;
-                httpRequestBody.put(data.getName(), data.getValue());
-            }
-        }
-        decoder.destroy();
+    protected Map<String, Object> parseHttpRequestBody(final HttpRequest 
httpRequest) throws IOException {

Review Comment:
   The namespace should be `private`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@eventmesh.apache.org
For additional commands, e-mail: issues-h...@eventmesh.apache.org

Reply via email to