Class: Dragonfly::Middleware
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, dragonfly_app_name = nil) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, dragonfly_app_name = nil) ⇒ Middleware
Returns a new instance of Middleware.
6 7 8 9 |
# File 'lib/dragonfly/middleware.rb', line 6 def initialize(app, dragonfly_app_name=nil) @app = app @dragonfly_app_name = dragonfly_app_name end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/dragonfly/middleware.rb', line 11 def call(env) response = Dragonfly.app(@dragonfly_app_name).call(env) headers = response[1].transform_keys(&:downcase) if headers['x-cascade'] == 'pass' @app.call(env) else response end end |