class Configuration
CORS feature configuration
Configuration()
CORS feature configuration |
var allowCredentials: Boolean
Allow sending credentials |
|
var allowNonSimpleContentTypes: Boolean
Allow sending requests with non-simple content-types. The following content types are considered simple: |
|
var allowSameOrigin: Boolean
Allow requests from the same origin |
|
val exposedHeaders: MutableSet<String>
Exposed HTTP headers that could be accessed by a client |
|
val headerPredicates: MutableList<(String) -> Boolean>
If present represents the prefix for headers which are permitted in cors requests. |
|
val headers: MutableSet<String>
Allowed CORS headers |
|
val hosts: MutableSet<String>
Allowed CORS hosts |
|
var
Max-Age for cached CORS options |
|
var maxAgeInSeconds: Long
Duration in seconds to tell the client to keep the host in a list of known HSTS hosts. |
|
val methods: MutableSet<HttpMethod>
Allowed HTTP methods |
fun allowHeaders(predicate: (String) -> Boolean): Unit
Allow headers that match predicate |
|
fun allowHeadersPrefixed(headerPrefix: String): Unit
Allow headers prefixed with headerPrefix |
|
fun allowXHttpMethodOverride(): Unit
Allow to send |
|
fun anyHost(): Unit
Allow requests from any host |
|
fun exposeHeader(header: String): Unit
Allow to expose header. It adds the header to |
|
fun
Allow to expose |
|
fun header(header: String): Unit
Allow sending header |
|
fun host(host: String, schemes: List<String> = listOf("http"), subDomains: List<String> = emptyList()): Unit
Allow requests from the specified domains and schemes |
|
fun method(method: HttpMethod): Unit
Please note that CORS operates ONLY with REAL HTTP methods
and will never consider overridden methods via |
val
Default HTTP headers that are always allowed by CORS |
|
val CorsDefaultMethods: Set<HttpMethod>
Default HTTP methods that are always allowed by CORS |
|
val CorsSimpleContentTypes: Set<ContentType>
The allowed set of content types that are allowed by CORS without preflight check |
|
val CorsSimpleRequestHeaders: Set<String>
Default HTTP headers that are always allowed by CORS
(simple request headers according to https://www.w3.org/TR/cors/#simple-header )
Please note that |
|
val CorsSimpleResponseHeaders: Set<String>
Default HTTP headers that are always allowed by CORS to be used in response (simple request headers according to https://www.w3.org/TR/cors/#simple-header ) |
var Configuration. |
|
var Configuration.maxAgeDuration: <ERROR CLASS>
Duration to tell the client to keep CORS options. |