Skip to content

Commit

Permalink
Merge pull request #119 from TeamMody/118-hotfix-cors-에러-해결
Browse files Browse the repository at this point in the history
🚨 [HOTFIX] #118- CORS 에러 수정
  • Loading branch information
dong99u authored Feb 9, 2025
2 parents cfc84c4 + dfb6344 commit 34bc701
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/com/example/mody/global/config/CorsMvcConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ public class CorsMvcConfig implements WebMvcConfigurer {

@Override
public void addCorsMappings(CorsRegistry corsRegistry) {

corsRegistry.addMapping("/**")
.exposedHeaders("Set-Cookie")
.allowedOrigins("http://localhost:3000");
.allowedOrigins(
"http://localhost:5173", // 현재 요청 URL
"https://kkoalla.app",
"https://kkoalla.app:5173",
"https://kkoalla.app:8443"
)
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedHeaders("*")
.allowCredentials(true);
}
}

0 comments on commit 34bc701

Please sign in to comment.