mirror of
https://github.com/headporter81/specialsource-homepage-backend.git
synced 2026-12-06 07:41:09 +09:00
fix : 운영 도메인(https://new.specialsource.company) CORS 허용
SpecialSource Backend CI/CD / build-and-deploy (push) Successful in 54s
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:
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();
|
||||||
|
|||||||
Reference in new issue
Block a user