Skip to content

Commit

Permalink
[HOTFIX] CORS 에러 해결
Browse files Browse the repository at this point in the history
[HOTFIX] CORS 에러 해결
  • Loading branch information
siyeonkm authored Sep 3, 2023
2 parents d3b444d + a0059eb commit 8c338e5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions q-admin/src/main/java/com/qcard/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@ public CorsFilter corsFilter(){
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
config.addAllowedOrigin("http://localhost:3000");
config.addAllowedHeader("Authorization");
config.addAllowedHeader("Content-Type");
config.addAllowedHeader("charset");
config.addAllowedOrigin("http://localhost:3001");
config.addAllowedOrigin("https://qcard.co.kr");
config.addAllowedOrigin("https://www.qcard.co.kr");
config.addAllowedHeader("*");
config.addAllowedMethod("*");
config.setMaxAge(3600L);
config.addExposedHeader("Authorization");
config.addExposedHeader("");
config.addExposedHeader("Location");
config.setMaxAge(3600L);

UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", config);
Expand Down

0 comments on commit 8c338e5

Please sign in to comment.