Skip to content

CORSMiddleware

Josh Wright edited this page Jan 14, 2021 · 3 revisions

CORSMiddleware

The MIT License (MIT)

public final class CORSMiddleware: Middleware

Copyright (c) 2020 Qutheory, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Courtesy of https://github.com/vapor/vapor Middleware that adds support for CORS settings in request responses. For configuration of this middleware please use the CORSMiddleware.Configuration object.

Inheritance

Middleware

Initializers

init(configuration:)

Creates a CORS middleware with the specified configuration.

public init(configuration: Configuration = .default())

Parameters

  • configuration: Configuration used for populating headers in response for CORS requests.

Properties

configuration

Configuration used for populating headers in response for CORS requests.

let configuration: Configuration

Methods

intercept(_:next:)

public func intercept(_ request: Request, next: @escaping Next) throws -> EventLoopFuture<Response>
Alchemy
Types
Protocols
Global Typealiases
Global Variables
Global Functions
Fusion
Types
Protocols
Papyrus
Types
Protocols
Clone this wiki locally