Skip to content

Commit

Permalink
refactor: CORS 설정 AllowedHeaders 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
thun0514 committed Jul 12, 2024
1 parent e898bd3 commit ade6015
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/jungle/HandTris/global/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000", "https://handtris.vercel.app")
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedHeaders("content-type", "authorization", "x-requested-with")
.allowedHeaders("content-type", "Authorization", "Authorization-Refresh", "x-requested-with")
.exposedHeaders("Set-Cookie")
// .exposedHeaders("content-type", "x-requested-with")
.allowCredentials(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Arrays.asList("http://localhost:3000", "https://handtris.vercel.app"));
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
configuration.setAllowedHeaders(Arrays.asList("content-type", "authorization", "x-requested-with"));
configuration.setAllowedHeaders(Arrays.asList("content-type", "Authorization", "Authorization-Refresh", "x-requested-with"));
configuration.setAllowCredentials(true);
configuration.setExposedHeaders(Collections.singletonList("Set-Cookie"));
configuration.setExposedHeaders(Collections.singletonList("Authorization"));
Expand Down

0 comments on commit ade6015

Please sign in to comment.