Class: Rack::CookieLogger::Middleware
- Inherits:
-
Object
- Object
- Rack::CookieLogger::Middleware
- Defined in:
- lib/rack/cookie_logger/middleware.rb
Overview
Logs:
- request cookies (the
Cookie:header) - response cookies (the
Set-Cookie:header)
Constant Summary collapse
- LOG_PREFIX =
'CookieLogger: '- SENSITIVE_COOKIE_SUFFIXES =
TODO: Make these configurable
[ 'session', 'credentials', 'password', 'token' ].freeze
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
20 21 22 |
# File 'lib/rack/cookie_logger/middleware.rb', line 20 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/rack/cookie_logger/middleware.rb', line 24 def call(env) @logger = env[::Rack::RACK_ERRORS] (::Rack::Request.new(env)) status, headers, body = @app.call(env) (::Rack::Response.new([], status, headers)) [status, headers, body] end |