Skip to content

Commit

Permalink
HOTFIX: CORS 설정 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yechan-kim committed Jul 31, 2024
1 parent 6bf63ad commit 80af3ac
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.loginPage("/login/github"))
.authorizeHttpRequests((authorize) ->
authorize
.requestMatchers("/", "/v3/api-docs/**", "/swagger-ui/**",
.requestMatchers("/", "/v3/api-docs/**", "/swagger-ui/**", "/commit/**",
"/login/**", "/auth/**", "/h2-console/**", "/error/**").permitAll()
.anyRequest().authenticated()
)
Expand All @@ -69,6 +69,7 @@ CorsConfigurationSource corsConfigurationSource() {
configuration.setAllowedMethods(Arrays.asList("HEAD", "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));
configuration.setAllowCredentials(true);
configuration.setAllowedHeaders(List.of("*"));
configuration.setExposedHeaders(Arrays.asList("Authorization, Authorization-refresh"));

UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
Expand Down

0 comments on commit 80af3ac

Please sign in to comment.