File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
src/main/java/org/dfbf/soundlink/global/config Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 66
77@ Configuration
88public class WebConfig implements WebMvcConfigurer {
9- // private static final String DEVELOP_FRONT_ADDRESS = "http://localhost:3000";
10- //
9+ /**
10+ * 스프링부트 5.3 이후,
11+ * allowCredentials가 true일 때, allowedOrigins에 특수 값인 "*" 추가할 수 없게 되었다.
12+ * 대신 allowOriginPatterns를 사용해야 한다.
13+ */
14+
15+ private static final String DEVELOP_FRONT_ADDRESS = "http://localhost:3000" ;
16+
17+ // Main에 적용
1118// @Override
1219// public void addCorsMappings(CorsRegistry registry) {
1320// registry.addMapping("/**")
@@ -18,13 +25,14 @@ public class WebConfig implements WebMvcConfigurer {
1825// .allowCredentials(true);
1926// }
2027
28+ // Develop에 적용
2129 @ Override
2230 public void addCorsMappings (CorsRegistry registry ) {
2331 registry .addMapping ("/**" ) // 모든 엔드포인트
24- .allowedOrigins ("*" ) // 모든 도메인 허용
32+ .allowedOriginPatterns ("*" ) // 모든 도메인 허용
2533 .allowedMethods ("*" ) // 모든 HTTP 메서드 허용
2634 .allowedHeaders ("*" ) // 모든 헤더 허용
2735 .exposedHeaders ("*" ) // 모든 응답 헤더 허용
28- .allowCredentials (false ); // 인증 정보는 제외
36+ .allowCredentials (true ); // 인증 정보는 제외
2937 }
3038}
You can’t perform that action at this time.
0 commit comments