Class: Webhookdb::Service::Middleware::SessionReader
- Inherits:
-
Object
- Object
- Webhookdb::Service::Middleware::SessionReader
- Defined in:
- lib/webhookdb/service/middleware.rb
Overview
We always want a session to be written, even if noop requests, so always force a write if the session isn’t loaded.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ SessionReader
constructor
A new instance of SessionReader.
Constructor Details
#initialize(app) ⇒ SessionReader
Returns a new instance of SessionReader.
85 86 87 |
# File 'lib/webhookdb/service/middleware.rb', line 85 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
89 90 91 92 |
# File 'lib/webhookdb/service/middleware.rb', line 89 def call(env) env["rack.session"]["_"] = "_" unless env["rack.session"].loaded? @app.call(env) end |