-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not possible to use allowedOrigins "*" in StompEndpointRegistry after upgrade to Spring Boot 2.4.0 #26111
Comments
Thanks for the report. The behaviour that you're seeing is due to these changes in Spring Framework. We'll transfer this issue to the Framework team so that they can take a look. |
#25016 introduced the ability to configure allowedOriginPatterns in addition to just I'll add those for 5.3.2. You'll then need to switch to |
This is now superseded by #26108. |
When I implement WebSocketMessageBrokerConfigurer, I'm not asked to override registerStompEndpoints() method. Am I supposed to use Java 11 ? I'm on Java 8 - Maven 2.4.2 |
@JeromeRider, all are default methods and so none are required. Imagine that there are several of these in one application. They are all applied, and one might register endpoints while others might not. |
This massively burned us during upgrade, why was this breaking change not mentioned in the release notes? |
@richvim I'm sorry to hear that. It is mentioned here although I can see how we should probably more explicitly mention STOMP web messaging as part of that. |
The interface It's supposed to be there right? |
@alrawasabed yes it should be there. I've created #26593. |
cors 간단한 이슈 해결 cors정책을 모든 도메인에 대한 허용으로 바꾸기 위해 addAllowedOrigin("*")으로 했었는데 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. 브라우저에서 요청을 보내면 위와같은 알아 듣기 힘든 오류를 뱉음 spring-projects/spring-framework#26111 버전 문제인 듯하고 좀더 조사필요 일단 addAllowedOriginPattern("*")으로 메소드를 변경하니 원하는 대로 동작
`Access-Control-Allow-Origin: *` is not allowed when `Access-Control-Allow-Credentials: true`. Spring introduced allowedOriginPatterns() in 5.3.2. If any of the patterns matches the origin of the _request_, the it is used as a value of `Access-Control-Allow-Origin` in the response. For context, see spring-projects/spring-framework#26111.
`Access-Control-Allow-Origin: *` is not allowed when `Access-Control-Allow-Credentials: true`. Spring introduced allowedOriginPatterns() in 5.3.2. If any of the patterns matches the origin of the _request_, the it is used as a value of `Access-Control-Allow-Origin` in the response. For context, see spring-projects/spring-framework#26111.
Not sure if this should be filed under Spring Boot or Spring framework, but I put it here since Spring Boot Starter is in use.
After upgrading to use Spring Boot 2.4.0 from 2.3.x, it does not seem to be possible to use allowedOrigins = "*" in the StompEndpointRegistry. When connecting it results in the following Error:
However, allowedOriginPatterns i not something that is available on the StompEndpointRegistry, only allowedOrigins is available.
Code to reproduce
Start the server on port 8080 and host the host the html file on another port and open it in a browser.
The text was updated successfully, but these errors were encountered: