class Cors::Handler

Overview

TODO Handle wildcard origins (*.example.com) in configuration

Included Modules

Defined in:

handler.cr

Constant Summary

ALLOWED_HEADERS_DEFAULT = ["origin", "accept", "content-type", "x-requested-with"]
ALLOWED_METHODS_DEFAULT = ["GET", "POST", "PUT"]
Log = ::Log.for("cors")
VARY_HEADERS = ["Origin", "Access-Control-Request-Method", "Access-Control-Request-Headers"]

Constructors

Instance Method Summary

Constructor Detail

def self.new(respond_ok : Proc(HTTP::Server::Context, Nil), max_age : Int32 = 0, allow_credentials : Bool = false, allowed_origins : Array(String) = [] of String, allowed_methods : Array(String) = [] of String, allowed_headers : Array(String) = [] of String, exposed_headers : Array(String) = [] of String) #

[View source]

Instance Method Detail

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

[View source]