Class: Upfluence::HTTP::Middleware::CORS
- Inherits:
-
Object
- Object
- Upfluence::HTTP::Middleware::CORS
- Defined in:
- lib/upfluence/http/middleware/cors.rb
Constant Summary collapse
- HEADERS =
{ 'Access-Control-Allow-Origin' => '*', 'Access-Control-Allow-Headers' => 'Authorization, Content-Type, Scope, X-Upfluence-Plugin-Version', 'Access-Control-Allow-Methods' => 'GET, POST, PUT, OPTIONS, DELETE' }.freeze
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, headers = nil) ⇒ CORS
constructor
A new instance of CORS.
Constructor Details
Instance Method Details
#call(env) ⇒ Object
16 17 18 19 |
# File 'lib/upfluence/http/middleware/cors.rb', line 16 def call(env) status, headers, body = (env) ? default_response : @app.call(env) [status, merge_headers(headers), body] end |