From 79bd41cee92d201bcfac4e03f248a4f5fb29634c Mon Sep 17 00:00:00 2001 From: Arachne <66822642+Arachneee@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:37:02 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=BF=A0=ED=82=A4=20=EC=9D=B8=EC=A6=9D?= =?UTF-8?q?=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95=20(#235)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/server/haengdong/config/AdminInterceptor.java | 5 +++-- server/src/main/resources/application.yml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/server/haengdong/config/AdminInterceptor.java b/server/src/main/java/server/haengdong/config/AdminInterceptor.java index da9149b29..c3ca1c943 100644 --- a/server/src/main/java/server/haengdong/config/AdminInterceptor.java +++ b/server/src/main/java/server/haengdong/config/AdminInterceptor.java @@ -3,6 +3,7 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import lombok.extern.slf4j.Slf4j; +import org.springframework.http.HttpMethod; import org.springframework.web.servlet.HandlerInterceptor; import server.haengdong.application.AuthService; import server.haengdong.exception.AuthenticationException; @@ -23,8 +24,8 @@ public AdminInterceptor(AuthService authService, AuthenticationExtractor authent public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { log.trace("login request = {}", request.getRequestURI()); - String method = request.getMethod(); - if (method.equals("GET")) { + HttpMethod method = HttpMethod.valueOf(request.getMethod()); + if (HttpMethod.GET.equals(method) || HttpMethod.OPTIONS.equals(method)) { return true; } diff --git a/server/src/main/resources/application.yml b/server/src/main/resources/application.yml index e3465c9ad..28c87485f 100644 --- a/server/src/main/resources/application.yml +++ b/server/src/main/resources/application.yml @@ -29,7 +29,7 @@ security: expire-length: 604800 # 1주일 cookie: - http-only: true + http-only: false secure: false path: / max-age: 7D