class Amber::Pipe::CORS
- Amber::Pipe::CORS
- Amber::Pipe::Base
- Reference
- Object
Defined in:
amber/pipes/cors.crConstant Summary
-
ALLOW_HEADERS =
["Accept", "Content-Type"] of ::String
-
ALLOW_METHODS =
["POST", "PUT", "PATCH", "DELETE"] of ::String
-
FORBIDDEN =
"Forbidden for invalid origins, methods or headers"
Constructors
Instance Method Summary
-
#call(context : HTTP::Server::Context)
Execution of this handler.
- #credentials : Bool
- #credentials=(credentials : Bool)
- #forbidden(context)
- #headers : Array(String)
- #headers=(headers : Array(String))
- #max_age : Int32?
- #max_age=(max_age : Int32 | Nil)
- #methods : Array(String)
- #methods=(methods : Array(String))
- #origins : Array(Regex | String)
- #origins=(origins : Array(Regex | String))
Instance methods inherited from class Amber::Pipe::Base
call(context : HTTP::Server::Context)
call
Constructor Detail
def self.new(origins : OriginType = ["*", %r()], methods : Array(String) = ALLOW_METHODS, headers : Array(String) = ALLOW_HEADERS, credentials : Bool = false, max_age : Int32 | Nil = 0, expose_headers : Array(String) | Nil = nil, vary : String | Nil = nil)
#
Instance Method Detail
def call(context : HTTP::Server::Context)
#
Description copied from class Amber::Pipe::Base
Execution of this handler.