스프링(Spring)
[Spring Boot] CORS 설정 시 addCorsMappings 관련 에러
Gyoogle
2021. 11. 18. 22:55
728x90
반응형
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("*")
728x90
반응형