Skip to content

struct Athena::Framework::Listeners::CORS
inherits Struct #

Supports Cross-Origin Resource Sharing (CORS) requests.

Handles CORS preflight OPTIONS requests as well as adding CORS headers to each response. See ATH::Bundle::Schema::Cors for information on configuring the listener.

Tip

Set your Log::Severity to TRACE to help debug the listener.

Constants#

SAFELISTED_HEADERS = ["accept", "accept-language", "content-language", "content-type", "origin"]#

SAFELISTED_METHODS = ["GET", "POST", "HEAD"]#

Methods#

#on_request(event : ATH::Events::Request) : Nil#

View source

#on_response(event : ATH::Events::Response) : Nil#

View source