Class: CautionTape::Middleware
- Inherits:
-
Object
- Object
- CautionTape::Middleware
- Defined in:
- lib/caution_tape/middleware.rb
Overview
Rack middleware that injects the environment chrome into HTML responses, just before
Rack middleware that injects the environment chrome into HTML responses, just before
.
"</body>"
A new instance of Middleware.
Returns a new instance of Middleware.
9 10 11 |
# File 'lib/caution_tape/middleware.rb', line 9 def initialize(app) @app = app end |
13 14 15 16 17 18 19 |
# File 'lib/caution_tape/middleware.rb', line 13 def call(env) status, headers, body = @app.call(env) config = CautionTape.configuration return [status, headers, body] unless config.enabled && html?(headers) inject(status, headers, body, config) end |