Initializer
init(allowedOrigin:allowedMethods:allowedHeaders:allowCredentials:cacheExpiration:exposedHeaders:)
Instantiate a CORSConfiguration struct that can be used to create a
CORSConfiguration middleware for adding support for CORS in your responses.init(allowedOrigin: CORSMiddleware.AllowOriginSetting, allowedMethods: [HTTPMethod], allowedHeaders: [HTTPHeaders.Name], allowCredentials: Bool = false, cacheExpiration: Int? = 600, exposedHeaders: [HTTPHeaders.Name]? = nil)
Parameters
allowedOriginSetting that controls which origin values are allowed.
allowedMethodsMethods that are allowed for a CORS request response.
allowedHeadersHeaders that are allowed in a response for CORS request.
allowCredentialsIf cookies and other credentials will be sent in the response.
cacheExpirationOptionally sets expiration of the cached pre-flight request in seconds.
exposedHeadersHeaders exposed in the response of pre-flight request.