CorsCallback

class CorsCallback(allowedOrigin: Regex, allowedMethods: Set<HttpMethod> = ALL, allowedHeaders: Set<String> = emptySet(), exposedHeaders: Set<String> = emptySet(), supportCredentials: Boolean = true, preFlightStatus: HttpStatus = NO_CONTENT_204, preFlightMaxAge: Long = 0) : Function1<HttpContext, HttpContext>

HTTP CORS callback. It holds info for CORS.

Constructors

Link copied to clipboard
constructor(allowedOrigin: String = "*", allowedMethods: Set<HttpMethod> = ALL, allowedHeaders: Set<String> = emptySet(), exposedHeaders: Set<String> = emptySet(), supportCredentials: Boolean = true, preFlightStatus: HttpStatus = NO_CONTENT_204, preFlightMaxAge: Long = 0)
constructor(allowedOrigin: Regex, allowedMethods: Set<HttpMethod> = ALL, allowedHeaders: Set<String> = emptySet(), exposedHeaders: Set<String> = emptySet(), supportCredentials: Boolean = true, preFlightStatus: HttpStatus = NO_CONTENT_204, preFlightMaxAge: Long = 0)

Functions

Link copied to clipboard
open operator override fun invoke(context: HttpContext): HttpContext