class Radbas::CORSMiddleware

Overview

Adds CORS headers and answers preflight requests.

origin is * or a single origin. credentials (cookies, auth headers) requires a single origin.

Included Modules

Defined in:

radbas-framework/middleware/cors_middleware.cr

Constructors

Instance Method Summary

Instance methods inherited from module Radbas::Middleware

call(context : Context, delegate : Next) : Nil call

Constructor Detail

def self.new(origin : String = "*", methods : String = "GET, HEAD, POST, PUT, PATCH, DELETE", headers : String = "*", expose_headers : String | Nil = nil, credentials : Bool = false, max_age : Time::Span = 1.day) #

[View source]

Instance Method Detail

def call(context : Context, delegate : Next) : Nil #

[View source]