fix : 운영 도메인(https://new.specialsource.company) CORS 허용
SpecialSource Backend CI/CD / build-and-deploy (push) Successful in 54s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
headporterandClaude Opus 5.5 committed 2026-11-17 15:53:01 +09:00
1 parent c9590e91a9
commit b4ce841613
1 file changed
+3 -2
@@ -39,11 +39,12 @@ public class SecurityConfig {
return http.build(); return http.build();
} }
// 프론트 개발 서버(localhost:3000 등)에서의 호출 허용 // 프론트 개발 서버(localhost:3000 등)와 운영 도메인에서의 호출 허용
// (운영은 nginx 경유라 백엔드가 http로 받으므로 https Origin을 다른 출처로 판단함)
@Bean @Bean
public CorsConfigurationSource corsConfigurationSource() { public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration config = new CorsConfiguration(); CorsConfiguration config = new CorsConfiguration();
config.setAllowedOriginPatterns(List.of("http://localhost:*")); config.setAllowedOriginPatterns(List.of("http://localhost:*", "https://new.specialsource.company"));
config.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "OPTIONS")); config.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "OPTIONS"));
config.setAllowedHeaders(List.of("*")); config.setAllowedHeaders(List.of("*"));
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();