Skip to content

Commit

Permalink
fix: (#138) Swagger URI 허용하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
woo-chang committed Jul 26, 2023
1 parent 5142d02 commit a42f5a9
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
"/health-check",
"/auth/kakao/callback",
"/categories/guest",
"/swagger-ui.html",
"/v3/api-docs/**",
"/swagger-ui/**"
"/swagger-ui.html"
);

private static final List<String> ALLOWED_START_URIS = List.of(
"/v3/api-docs",
"/swagger-ui"
);

private final TokenProcessor tokenProcessor;
Expand All @@ -40,8 +43,8 @@ protected void doFilterInternal(

@Override
protected boolean shouldNotFilter(final HttpServletRequest request) {
return ALLOWED_URIS.stream()
.anyMatch(url -> request.getRequestURI().contains(url));
return ALLOWED_URIS.stream().anyMatch(url -> request.getRequestURI().contains(url))
|| ALLOWED_START_URIS.stream().anyMatch(url -> request.getRequestURI().startsWith(url));
}

}

0 comments on commit a42f5a9

Please sign in to comment.