Configuration
class Configuration
CORS feature configuration
Constructors
Configuration() CORS feature configuration |
Properties
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 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 |
Functions
fun allowXHttpMethodOverride(): Unit Allow to send |
|
fun anyHost(): Unit Allow requests from any host |
|
Allow to expose header. It adds the header to |
|
fun Allow to expose |
|
Allow sending header |
|
fun host( 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 |
Companion Object Properties
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 |
|
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 |
|
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 ) |
Extension Properties
var Configuration. |
|
var Configuration.maxAgeDuration: <ERROR CLASS> Duration to tell the client to keep CORS options. |