From 528dcf5bf423c9b3dcd12a0a39f76584fc45acd9 Mon Sep 17 00:00:00 2001 From: vernedeng Date: Wed, 9 Aug 2023 14:36:40 +0800 Subject: [PATCH] [INLONG-8671][Manager] Fix no method parameter of form data in POST request (#8672) --- .../apache/inlong/manager/web/utils/HttpContextUtils.java | 1 + .../inlong/manager/web/utils/InlongRequestWrapper.java | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/utils/HttpContextUtils.java b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/utils/HttpContextUtils.java index d2544160b20..ce17a35eb05 100644 --- a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/utils/HttpContextUtils.java +++ b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/utils/HttpContextUtils.java @@ -74,6 +74,7 @@ public static Map getParameterMap(HttpServletRequest request) } } } + paramMap.putAll(request.getParameterMap()); return paramMap; } diff --git a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/utils/InlongRequestWrapper.java b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/utils/InlongRequestWrapper.java index efbe6846e61..00a839dcfd3 100644 --- a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/utils/InlongRequestWrapper.java +++ b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/utils/InlongRequestWrapper.java @@ -51,11 +51,16 @@ public class InlongRequestWrapper extends HttpServletRequestWrapper { public InlongRequestWrapper(HttpServletRequest request) { super(request); - this.bodyParams = HttpContextUtils.getBodyString(request); this.params = HttpContextUtils.getParameterMap(request); + this.bodyParams = HttpContextUtils.getBodyString(request); this.headers = HttpContextUtils.getHeaderMapAll(request); } + @Override + public int getContentLength() { + return bodyParams.length(); + } + @Override public String getParameter(String name) { String result;