From 50b2b929caa5306a695e8dee98a0c8a602ce26fe Mon Sep 17 00:00:00 2001 From: limju Date: Wed, 8 Nov 2023 15:02:21 +0900 Subject: [PATCH] fix: Parameter logging fix --- .../core/spring/filter/ReadableRequestWrapper.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mens-core/src/main/java/kr/xit/core/spring/filter/ReadableRequestWrapper.java b/mens-core/src/main/java/kr/xit/core/spring/filter/ReadableRequestWrapper.java index bab5398..5f87be9 100644 --- a/mens-core/src/main/java/kr/xit/core/spring/filter/ReadableRequestWrapper.java +++ b/mens-core/src/main/java/kr/xit/core/spring/filter/ReadableRequestWrapper.java @@ -12,12 +12,12 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.stream.Collectors; - import javax.servlet.ReadListener; import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; - +import kr.xit.core.support.utils.Checks; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.json.simple.JSONArray; @@ -25,10 +25,6 @@ import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; import org.springframework.http.MediaType; -import org.springframework.web.filter.OncePerRequestFilter; - -import kr.xit.core.support.utils.JsonUtils; -import lombok.extern.slf4j.Slf4j; /** *
@@ -98,7 +94,11 @@ public class ReadableRequestWrapper extends HttpServletRequestWrapper {
         Iterator iterator = jsonObject.keySet().iterator();
         while (iterator.hasNext()) {
             String key = (String)iterator.next();
-            setParameter(key, jsonObject.get(key).toString().replace("\"", "\\\""));
+            if(Checks.isNotEmpty(jsonObject.get(key))) {
+                setParameter(key, jsonObject.get(key).toString().replace("\"", "\\\""));
+            }else{
+                setParameter(key, jsonObject.get(key) == null? null:StringUtils.EMPTY);
+            }
         }
     }