|
|
|
@ -12,16 +12,10 @@ public class WebConfiguration implements WebMvcConfigurer {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void addCorsMappings(CorsRegistry registry) {
|
|
|
|
public void addCorsMappings(CorsRegistry registry) {
|
|
|
|
registry.addMapping("/**")
|
|
|
|
registry.addMapping("/**")
|
|
|
|
.allowedOriginPatterns("*") // allowedOrigins 대신 사용
|
|
|
|
.allowedOriginPatterns("http://localhost:3000", "http://10.10.11.144") // 허용할 Origin 지정
|
|
|
|
.allowedMethods(
|
|
|
|
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
|
|
|
HttpMethod.GET.name(),
|
|
|
|
.allowedHeaders("*") // 필요하면 "cuuva-jwt", "Content-Type", "Authorization" 명시 가능
|
|
|
|
HttpMethod.HEAD.name(),
|
|
|
|
.exposedHeaders("cuuva-jwt")
|
|
|
|
HttpMethod.POST.name(),
|
|
|
|
|
|
|
|
HttpMethod.PUT.name(),
|
|
|
|
|
|
|
|
HttpMethod.DELETE.name()
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
.allowedHeaders("cuuva-jwt", "Content-Type", "Authorization")
|
|
|
|
|
|
|
|
.exposedHeaders("cuuva-jwt") // 응답 헤더 노출
|
|
|
|
|
|
|
|
.allowCredentials(true)
|
|
|
|
.allowCredentials(true)
|
|
|
|
.maxAge(3600);
|
|
|
|
.maxAge(3600);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|