Skip to content

Commit

Permalink
[refactor] : CorsConfig 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
chahyunsoo committed May 9, 2024
1 parent 91cf602 commit 9673993
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/seoul/gonggong/global/config/CorsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowCredentials(true);
configuration.setAllowedOrigins(Collections.singletonList("http://localhost:3000"));

configuration.setAllowedOrigins(Arrays.asList("http://localhost:3000", "https://bokdakbang.store"));
configuration.addAllowedHeader("*");
configuration.setAllowedMethods(Arrays.asList("HEAD", "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));

urlBasedCorsConfigurationSource.registerCorsConfiguration("**", configuration);

urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", configuration);
return new CorsFilter(urlBasedCorsConfigurationSource);
}

Expand Down

0 comments on commit 9673993

Please sign in to comment.