Expose allowedOriginPatterns in SocketJS XML config

Closes gh-26108
This commit is contained in:
Rossen Stoyanchev
2020-11-18 21:20:38 +00:00
parent 8130bf505f
commit 684e695b08
8 changed files with 57 additions and 12 deletions

View File

@@ -17,7 +17,9 @@
</websocket:decorator-factories>
</websocket:transport>
<websocket:stomp-endpoint path=" /foo,/bar" allowed-origins="https://mydomain1.example,https://mydomain2.example">
<websocket:stomp-endpoint path=" /foo,/bar"
allowed-origins="https://mydomain1.example,https://mydomain2.example"
allowed-origin-patterns="https://*.mydomain.com">
<websocket:handshake-handler ref="myHandler"/>
<websocket:handshake-interceptors>
<bean class="org.springframework.web.socket.config.FooTestInterceptor"/>
@@ -25,7 +27,9 @@
</websocket:handshake-interceptors>
</websocket:stomp-endpoint>
<websocket:stomp-endpoint path="/test,/sockjs" allowed-origins="https://mydomain3.com,https://mydomain4.com">
<websocket:stomp-endpoint path="/test,/sockjs"
allowed-origins="https://mydomain3.com,https://mydomain4.com"
allowed-origin-patterns="https://*.mydomain.com">
<websocket:handshake-handler ref="myHandler"/>
<websocket:handshake-interceptors>
<bean class="org.springframework.web.socket.config.FooTestInterceptor"/>

View File

@@ -5,7 +5,7 @@
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/websocket https://www.springframework.org/schema/websocket/spring-websocket.xsd">
<websocket:handlers allowed-origins="https://mydomain1.example, https://mydomain2.example">
<websocket:handlers allowed-origins="https://mydomain1.example, https://mydomain2.example" allowed-origin-patterns="https://*.mydomain.example">
<websocket:mapping path="/test" handler="testHandler"/>
<websocket:sockjs name="testSockJsService" scheduler="testTaskScheduler" websocket-enabled="false"
session-cookie-needed="false" stream-bytes-limit="2048" disconnect-delay="256"