Skip to content

Commit bfc0996

Browse files
authored
Merge pull request #149 from pirogramming/main
원준
2 parents 5a7c2e0 + 355920d commit bfc0996

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

backend/pirocheck/src/main/java/backend/pirocheck/User/filter/SessionCheckFilter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ protected void doFilterInternal(HttpServletRequest request,
1818
throws ServletException, IOException {
1919

2020
String path = request.getRequestURI();
21+
String method = request.getMethod();
2122

22-
// 로그인/로그아웃 요청은 세션 체크 제외
23-
if (path.startsWith("/api/login") || path.startsWith("/api/logout")) {
23+
// CORS preflight 요청(OPTIONS) 또는 로그인/로그아웃 요청은 세션 체크 제외
24+
if ("OPTIONS".equals(method) || path.startsWith("/api/login") || path.startsWith("/api/logout")) {
2425
filterChain.doFilter(request, response); // 다음 필터나 컨트롤러로 넘기는 명령어
2526
return; // 세션 검사 안함
2627
}

0 commit comments

Comments
 (0)