@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2020 the original author or authors .
* Copyright 2002 - 2021 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -310,17 +310,24 @@ public abstract class AbstractSockJsService implements SockJsService, CorsConfig
@@ -310,17 +310,24 @@ public abstract class AbstractSockJsService implements SockJsService, CorsConfig
}
/ * *
* Configure allowed { @code Origin } header values . This check is mostly
* designed for browsers . There is nothing preventing other types of client
* to modify the { @code Origin } header value .
* < p > When SockJS is enabled and origins are restricted , transport types
* that do not allow to check request origin ( Iframe based transports )
* are disabled . As a consequence , IE 6 to 9 are not supported when origins
* are restricted .
* < p > Each provided allowed origin must have a scheme , and optionally a port
* ( e . g . "https://example.org" , "https://example.org:9090" ) . An allowed origin
* string may also be "*" in which case all origins are allowed .
* Set the origins for which cross - origin requests are allowed from a browser .
* Please , refer to { @link CorsConfiguration # setAllowedOrigins ( List ) } for
* format details and considerations , and keep in mind that the CORS spec
* does not allow use of { @code "*" } with { @code allowCredentials = true } .
* For more flexible origin patterns use { @link # setAllowedOriginPatterns }
* instead .
*
* < p > By default , no origins are allowed . When
* { @link # setAllowedOriginPatterns ( Collection ) allowedOriginPatterns } is also
* set , then that takes precedence over this property .
*
* < p > Note when SockJS is enabled and origins are restricted , transport types
* that do not allow to check request origin ( Iframe based transports ) are
* disabled . As a consequence , IE 6 to 9 are not supported when origins are
* restricted .
*
* @since 4 . 1 . 2
* @see # setAllowedOriginPatterns ( Collection )
* @see < a href = "https://tools.ietf.org/html/rfc6454" > RFC 6454 : The Web Origin Concept < / a >
* @see < a href = "https://github.com/sockjs/sockjs-client#supported-transports-by-browser-html-served-from-http-or-https" > SockJS supported transports by browser < / a >
* /
@ -330,19 +337,19 @@ public abstract class AbstractSockJsService implements SockJsService, CorsConfig
@@ -330,19 +337,19 @@ public abstract class AbstractSockJsService implements SockJsService, CorsConfig
}
/ * *
* Return configure allowed { @code Origin } header value s.
* Return the { @link # setAllowedOrigins ( Collection ) configured } allowed origin s.
* @since 4 . 1 . 2
* @see # setAllowedOrigins
* /
@SuppressWarnings ( "ConstantConditions" )
public Collection < String > getAllowedOrigins ( ) {
return this . corsConfiguration . getAllowedOrigins ( ) ;
}
/ * *
* A variant of { @link # setAllowedOrigins ( Collection ) } that accepts flexible
* domain patterns , e . g . { @code "https://*.domain1.com" } . Furthermore it
* always sets the { @code Access - Control - Allow - Origin } response header to
* the matched origin and never to { @code "*" } , nor to any other pattern .
* Alternative to { @link # setAllowedOrigins ( Collection ) } that supports more
* flexible patterns for specifying the origins for which cross - origin
* requests are allowed from a browser . Please , refer to
* { @link CorsConfiguration # setAllowedOriginPatterns ( List ) } for format
* details and other considerations .
* < p > By default this is not set .
* @since 5 . 2 . 3
* /
@ -354,7 +361,6 @@ public abstract class AbstractSockJsService implements SockJsService, CorsConfig
@@ -354,7 +361,6 @@ public abstract class AbstractSockJsService implements SockJsService, CorsConfig
/ * *
* Return { @link # setAllowedOriginPatterns ( Collection ) configured } origin patterns .
* @since 5 . 3 . 2
* @see # setAllowedOriginPatterns
* /
@SuppressWarnings ( "ConstantConditions" )
public Collection < String > getAllowedOriginPatterns ( ) {