Class: Navigable::Server::CORS::Middleware
- Inherits:
-
Object
- Object
- Navigable::Server::CORS::Middleware
- Defined in:
- lib/navigable/server/cors.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
21 22 23 |
# File 'lib/navigable/server/cors.rb', line 21 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
25 26 27 28 29 |
# File 'lib/navigable/server/cors.rb', line 25 def call(env) return @app.call(env) unless cors_configured? && cors_request?(env) cors_response end |