class Azu::Handler::CORS
- Azu::Handler::CORS
- Reference
- Object
Defined in:
azu/handler/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)
- #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))
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)
#