Skip to content

Commit

Permalink
refactor: CORS 설정 AllowedMethods PATCH 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
thun0514 committed Jul 12, 2024
1 parent ade6015 commit 9a18ace
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 @@ -28,7 +28,7 @@ public WebMvcConfigurer corsConfigurer() {
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000", "https://handtris.vercel.app")
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH")
.allowedHeaders("content-type", "Authorization", "Authorization-Refresh", "x-requested-with")
.exposedHeaders("Set-Cookie")
// .exposedHeaders("content-type", "x-requested-with")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
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.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"));
configuration.setAllowedHeaders(Arrays.asList("content-type", "Authorization", "Authorization-Refresh", "x-requested-with"));
configuration.setAllowCredentials(true);
configuration.setExposedHeaders(Collections.singletonList("Set-Cookie"));
Expand Down

0 comments on commit 9a18ace

Please sign in to comment.