Allow all origins for WebSocket requests

This commit is contained in:
Charles Gould 2017-02-02 23:43:01 -05:00
parent 8b048dbef9
commit 619ba22bca
2 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.2.RELEASE</version>
<version>1.5.1.RELEASE</version>
</parent>
<groupId>com.charego</groupId>

View File

@ -32,7 +32,8 @@ public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/stomp").withSockJS();
// Allow all origins: for JSFiddle, lol
registry.addEndpoint("/stomp").setAllowedOrigins("*").withSockJS();
}
}