From 597493912df646d553ce5b190d01c69730c94da2 Mon Sep 17 00:00:00 2001 From: Arachne <66822642+Arachneee@users.noreply.github.com> Date: Tue, 20 Aug 2024 21:54:25 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=A1=9C=EA=B9=85=20=EC=A0=81=EC=9A=A9?= =?UTF-8?q?=20=ED=9B=84=20=EC=98=88=EC=99=B8=20=EC=9D=91=EB=8B=B5=20?= =?UTF-8?q?=EB=B6=88=EA=B0=80=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?(#413)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/RequestServletFilter.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 server/src/main/java/server/haengdong/config/RequestServletFilter.java diff --git a/server/src/main/java/server/haengdong/config/RequestServletFilter.java b/server/src/main/java/server/haengdong/config/RequestServletFilter.java new file mode 100644 index 000000000..b1afdb6f8 --- /dev/null +++ b/server/src/main/java/server/haengdong/config/RequestServletFilter.java @@ -0,0 +1,23 @@ +package server.haengdong.config; + +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import java.io.IOException; +import org.springframework.stereotype.Component; +import org.springframework.web.util.ContentCachingRequestWrapper; + +@Component +public class RequestServletFilter implements Filter { + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { + ContentCachingRequestWrapper wrappedRequest = new ContentCachingRequestWrapper((HttpServletRequest) request); + + chain.doFilter(wrappedRequest, response); + } +}