Fix WebSocket CORS configs for trailing slashes

Related to https://github.com/spring-projects/spring-framework/issues/26892

The WebSocket tests with `allowedOrigins` fail now because CORS processor
in Spring Framework removes a trailing slash from the request where possible one
in the config is left as is.

* Remove the trailing slash from the CORS config to match the current SF behavior
This commit is contained in:
Artem Bilan
2021-05-09 18:38:02 -04:00
parent b84b60c732
commit 560c5918f7
2 changed files with 2 additions and 2 deletions

View File

@@ -318,7 +318,7 @@ public class StompInboundChannelAdapterWebSocketIntegrationTests {
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/ws")
.setHandshakeHandler(handshakeHandler())
.setAllowedOrigins("https://www.example.com/")
.setAllowedOrigins("https://www.example.com")
.addInterceptors(new HandshakeInterceptor() {
@Override

View File

@@ -263,7 +263,7 @@ public class WebSocketServerTests {
return new ServerWebSocketContainer("/ws")
.setHandshakeHandler(handshakeHandler())
.setDecoratorFactories(testWebSocketHandlerDecoratorFactory())
.setAllowedOrigins("https://www.example.com/")
.setAllowedOrigins("https://www.example.com")
.withSockJs();
}