Skip to content

Commit

Permalink
feat: 모든 출처에 대해 CORS 허용
Browse files Browse the repository at this point in the history
  • Loading branch information
hellomatia committed May 20, 2024
1 parent bacad9c commit f1d4bbf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/mlog/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ public class WebConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") // 모든 경로에 대해
.allowedOrigins("http://localhost:5173")
.allowedMethods("GET", "POST", "PUT", "DELETE") // 허용할 HTTP 메소드
.allowedOrigins("*") // 모든 출처 허용
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") // 모든 HTTP 메소드 허용
.allowedHeaders("*") // 모든 헤더 허용
.allowCredentials(true); // 쿠키를 포함한 요청 허용
}
}

0 comments on commit f1d4bbf

Please sign in to comment.