open class CorsRegistration
Assists with the creation of a CorsConfiguration instance mapped to a path pattern. By default all origins, headers, and credentials for GET, HEAD, and POST requests are allowed while the max age is set to 30 minutes.
Author
Sebastien Deleuze
Author
Rossen Stoyanchev
Author
Sam Brannen
Since
4.2
See Also
CorsConfigurationCorsRegistry
CorsRegistration(pathPattern: String)
Create a new CorsRegistration that allows all origins, headers, and credentials for |
open fun allowCredentials(allowCredentials: Boolean): CorsRegistration
Whether user credentials are supported. Be aware that enabling this option could increase the surface attack of the web application (for example via exposing sensitive user-specific information like CSRF tokens). By default credentials are not allowed. |
|
open fun allowedHeaders(vararg headers: String): CorsRegistration
Set the list of headers that a pre-flight request can list as allowed for use during an actual request. The special value A header name is not required to be listed if it is one of: By default all headers are allowed. |
|
open fun allowedMethods(vararg methods: String): CorsRegistration
Set the HTTP methods to allow, e.g. The special value By default "simple" methods |
|
open fun allowedOrigins(vararg origins: String): CorsRegistration
Set the origins to allow, e.g. The special value By default, all origins are allowed. |
|
open fun exposedHeaders(vararg headers: String): CorsRegistration
Set the list of response headers other than "simple" headers, i.e. Note that By default this is not set. |
|
open fun maxAge(maxAge: Long): CorsRegistration
Configure how long in seconds the response from a pre-flight request can be cached by clients. By default this is set to 1800 seconds (30 minutes). |