class Azu::Handler::CORS

Defined in:

azu/handler/cors.cr

Constant 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

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) #

[View source]

Instance Method Detail

def call(context : HTTP::Server::Context) #

[View source]
def credentials : Bool #

[View source]
def credentials=(credentials : Bool) #

[View source]
def forbidden(context) #

[View source]
def headers : Array(String) #

[View source]
def headers=(headers : Array(String)) #

[View source]
def max_age : Int32? #

[View source]
def max_age=(max_age : Int32 | Nil) #

[View source]
def methods : Array(String) #

[View source]
def methods=(methods : Array(String)) #

[View source]
def origins : Array(Regex | String) #

[View source]
def origins=(origins : Array(Regex | String)) #

[View source]