Skip to content

Index

port_http_server / com.hexagonkt.http.server / CorsSettings

CorsSettings

data class CorsSettings

HTTP CORS setting. It holds info for CORS.

Constructors

Name Summary
<init> CorsSettings(allowedOrigin:String= "*", allowedMethods:Set<Method> = ALL, allowedHeaders:Set<String> = emptySet(), exposedHeaders:Set<String> = emptySet(), supportCredentials:Boolean= true, preFlightStatus:Int= 204, preFlightMaxAge:Long= 0)
HTTP CORS setting. It holds info for CORS.CorsSettings(allowedOrigin:Regex, allowedMethods:Set<Method> = ALL, allowedHeaders:Set<String> = emptySet(), exposedHeaders:Set<String> = emptySet(), supportCredentials:Boolean= true, preFlightStatus:Int= 204, preFlightMaxAge:Long= 0)

Properties

Name Summary
allowedHeaders val allowedHeaders:Set<String>
allowedMethods val allowedMethods:Set<Method>
allowedOrigin val allowedOrigin:Regex
exposedHeaders val exposedHeaders:Set<String>
preFlightMaxAge val preFlightMaxAge:Long
preFlightStatus val preFlightStatus:Int
supportCredentials val supportCredentials:Boolean

Functions

Name Summary
accessControlAllowOrigin Provides the origin based on access control check for CORS.fun accessControlAllowOrigin(origin:String):String
allowOrigin Checks whether given origin is allowed.fun allowOrigin(origin:String):Boolean

Comments