Structure
CORSMiddleware.Configuration
Configuration used for populating headers in response for CORS requests.
struct Configuration
Topics
Initializers
init(allowedOrigin: AllowOriginSetting, allowedMethods: [HTTPRequest.Method], allowedHeaders: [HTTPField.Name], allowCredentials: Bool, cacheExpiration: Int?, exposedHeaders: [HTTPField.Name]?)Instantiate a CORSConfiguration struct that can be used to create aCORSConfigurationmiddleware for adding support for CORS in your responses.
Instance Properties
let allowCredentials: BoolIf set to yes, cookies and other credentials will be sent in the response for CORS request.let allowedHeaders: StringHeader string containing headers that are allowed in a response for CORS request.let allowedMethods: StringHeader string containing methods that are allowed for a CORS request response.let allowedOrigin: AllowOriginSettingSetting that controls which origin values are allowed.let cacheExpiration: Int?Optionally sets expiration of the cached pre-flight request. Value is in seconds.let exposedHeaders: String?Headers exposed in the response of pre-flight request.
Type Methods
static func `default`() -> ConfigurationDefault CORS configuration.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype