Class: RackTestCookieDisabler::Middleware
- Inherits:
-
Object
- Object
- RackTestCookieDisabler::Middleware
- Defined in:
- lib/racktest_cookie_disabler/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, options = {}) ⇒ Middleware
Returns a new instance of Middleware.
3 4 5 |
# File 'lib/racktest_cookie_disabler/middleware.rb', line 3 def initialize(app, = {}) @app = app end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/racktest_cookie_disabler/middleware.rb', line 7 def call(env) if env['CAPYBARA_DISABLE_COOKIES'] env.delete('HTTP_COOKIE') end @app.call(env) end |