From be4dec5a3039625e62d346dbb148206b602af6aa Mon Sep 17 00:00:00 2001 From: Charles7c Date: Tue, 24 Sep 2024 22:14:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(log/interceptor):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E9=85=8D=E7=BD=AE=E5=92=8C=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8C=85=E5=90=AB=E8=AF=B7=E6=B1=82=E3=80=81?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E4=BD=93=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../starter/log/interceptor/handler/LogFilter.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/interceptor/handler/LogFilter.java b/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/interceptor/handler/LogFilter.java index 7fea14c..d46a0d9 100644 --- a/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/interceptor/handler/LogFilter.java +++ b/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/interceptor/handler/LogFilter.java @@ -28,14 +28,12 @@ import org.springframework.web.util.ContentCachingRequestWrapper; import org.springframework.web.util.ContentCachingResponseWrapper; import org.springframework.web.util.WebUtils; -import top.continew.starter.log.core.enums.Include; import top.continew.starter.log.interceptor.autoconfigure.LogProperties; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.util.Objects; -import java.util.Set; /** * 日志过滤器 @@ -123,9 +121,7 @@ private boolean isRequestValid(HttpServletRequest request) { * @return true:是;false:否 */ private boolean isRequestWrapper(HttpServletRequest request) { - Set includeSet = logProperties.getIncludes(); - return !(request instanceof ContentCachingRequestWrapper) && (includeSet - .contains(Include.REQUEST_BODY) || includeSet.contains(Include.REQUEST_PARAM)); + return !(request instanceof ContentCachingRequestWrapper); } /** @@ -135,9 +131,7 @@ private boolean isRequestWrapper(HttpServletRequest request) { * @return true:是;false:否 */ private boolean isResponseWrapper(HttpServletResponse response) { - Set includeSet = logProperties.getIncludes(); - return !(response instanceof ContentCachingResponseWrapper) && (includeSet - .contains(Include.RESPONSE_BODY) || includeSet.contains(Include.RESPONSE_PARAM)); + return !(response instanceof ContentCachingResponseWrapper); } /**