Skip to content

Commit

Permalink
Merge pull request #133 from yooonwodyd/weekly
Browse files Browse the repository at this point in the history
refactor:[#84]- refact Security
  • Loading branch information
yooonwodyd authored Nov 15, 2024
2 parents a47ff7e + f46e4d1 commit 77ef08a
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,18 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
logger.info("Request Origin Header: {}", origin);
}

String requestMethod = request.getHeader("Access-Control-Request-Method");
String requestMethod = request.getHeader("cross-control-allow-origin");
if (requestMethod != null) {
logger.info("Access-Control-Request-Method Header: {}", requestMethod);
logger.info("cross-control-allow-origin: {}", requestMethod);
}

// 필터 체인을 통해 요청 처리
filterChain.doFilter(request, response);

// 모든 응답 헤더 로깅
logger.info("Logging all Response Headers:");
response.getHeaderNames().forEach(headerName -> {
String headerValue = response.getHeader(headerName);
logger.info("Response Header -> Name: '{}', Value: '{}'", headerName, headerValue);
});
// cors 관련 응답 헤더 로깅
String responseHeader = response.getHeader("Access-Control-Allow-Origin");
if (responseHeader != null) {
logger.info("Response Access-Control-Allow-Origin Header: {}", responseHeader);
}
}
}

0 comments on commit 77ef08a

Please sign in to comment.