participation-service WebConfig 추가
- CORS 설정 적용 - 모든 origin 패턴 허용 - 모든 HTTP 메서드 허용 - Credentials 허용
This commit is contained in:
parent
6948b48498
commit
5cac8ccc12
@ -24,7 +24,7 @@ import java.util.Arrays;
|
|||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
public class SecurityConfig {
|
public class SecurityConfig {
|
||||||
|
|
||||||
@Value("${cors.allowed-origins:http://localhost:*,https://kt-event-marketing-api.20.214.196.128.nip.io/api/v1}")
|
@Value("${cors.allowed-origins:*")
|
||||||
private String allowedOrigins;
|
private String allowedOrigins;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|||||||
@ -0,0 +1,32 @@
|
|||||||
|
package com.kt.event.participation.infrastructure.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Web Configuration
|
||||||
|
* CORS 설정 및 기타 웹 관련 설정
|
||||||
|
*
|
||||||
|
* @author System Architect
|
||||||
|
* @since 2025-10-30
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class WebConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CORS 설정
|
||||||
|
* - 모든 origin 허용 (개발 환경)
|
||||||
|
* - 모든 HTTP 메서드 허용
|
||||||
|
* - Credentials 허용
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void addCorsMappings(CorsRegistry registry) {
|
||||||
|
registry.addMapping("/**")
|
||||||
|
.allowedOriginPatterns("*")
|
||||||
|
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")
|
||||||
|
.allowedHeaders("*")
|
||||||
|
.allowCredentials(true)
|
||||||
|
.maxAge(3600);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user