스프링(Spring)

[Spring Boot] CORS 설정 시 addCorsMappings 관련 에러

반응형

CORS 설정 시 addCorsMappings 관련 에러

java.lang.IllegalArgumentException: When allowCredentials is true, allowedOrigins cannot contain the special value "*"since that cannot be set on the "Access-Control-Allow-Origin" response header. To allow credentials to a set of origins, list them explicitly or consider using "allowedOriginPatterns" instead.

 

스프링 부트에서 CORS 설정 시, .allowCredentials(true).allowedOrigins("*")를 동시에 사용할 수 없도록 업데이트 되었음.

해결 : .allowedOrigins("*").allowedOriginPatterns("*")



반응형

'스프링(Spring)' 카테고리의 다른 글

[JPA] Infinite Recursion  (0) 2021.11.18
Lombok 사용 시 주의할 점  (0) 2021.11.04
[Spring Data JPA] 더티 체킹 (Dirty Checking)  (0) 2021.09.13
[Spring Boot] Test Code  (0) 2021.08.23
[Spring Boot] SpringApplication  (0) 2021.08.22