Skip to content

Commit

Permalink
bug: CORS 또 수정
Browse files Browse the repository at this point in the history
OPTION 요청이 함께 오는 것을 확인 후 모든 메소드를 포함
  • Loading branch information
kanguk01 committed Oct 29, 2024
1 parent 22a2cfb commit 09a0272
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/splanet/splanet/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class WebConfig implements WebMvcConfigurer {
public void addCorsMappings(CorsRegistry registry) { //인터페이스 WebMvcConfigurer 상속
registry.addMapping("/**") //모든 경로를 허용해줄것이므로
.allowedOrigins("http://localhost:5173", "https://splanet.co.kr") //리소스 공유 허락할 origin 지정
.allowedMethods("GET", "POST", "PUT", "DELETE") //모든 메소드를 허용
.allowedMethods("DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT") //모든 메소드를 허용
.allowCredentials(true);
}
}

0 comments on commit 09a0272

Please sign in to comment.