fix: Parameter logging fix

dev
gitea-관리자 1 year ago
parent 83c07299d1
commit 50b2b929ca

@ -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;
/**
* <pre>
@ -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);
}
}
}

Loading…
Cancel
Save