![[SpringBoot/WebSocket+SocketJS] CORS 설정 시 에러 (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 or..](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FsKVLn%2FbtsgCCYbFj9%2FAAAAAAAAAAAAAAAAAAAAAIS9NHMBxIR15LiyeBkAxiBqgqaZo8NDSvF-cCKqlSK5%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3Dh1enZzL8wpw96xEdPBLEP2dS1iU%253D)
[SpringBoot/WebSocket+SocketJS] CORS 설정 시 에러 (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 or..Tech/트러블슈팅2023. 5. 24. 06:00
Table of Contents
728x90
728x90
에러 메세지
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설정 시 allowedCredentials true와, allowedOrigins "*"를 같이 사용할 수 없다.
해결
에러 메세지에 친절하게 나와있다.
allowedOrigins("*") 대신 allowedOriginPatterns("*")을 사용하여 해결.
728x90
300x250
@mag1c :: 개발잘하고싶다
diehreo@gmail.com
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!