Class: RailsSpotlight::Middlewares::HeaderMarker
- Inherits:
-
Object
- Object
- RailsSpotlight::Middlewares::HeaderMarker
- Includes:
- SkipRequestPaths
- Defined in:
- lib/rails_spotlight/middlewares/header_marker.rb
Constant Summary
Constants included from SkipRequestPaths
SkipRequestPaths::PATHS_TO_SKIP
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, app_config) ⇒ HeaderMarker
constructor
A new instance of HeaderMarker.
Constructor Details
#initialize(app, app_config) ⇒ HeaderMarker
Returns a new instance of HeaderMarker.
11 12 13 14 |
# File 'lib/rails_spotlight/middlewares/header_marker.rb', line 11 def initialize(app, app_config) @app = app @app_config = app_config end |
Instance Method Details
#call(env) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/rails_spotlight/middlewares/header_marker.rb', line 16 def call(env) request_path = env['PATH_INFO'] middleware = Rack::ResponseHeaders.new(app) do |headers| headers['X-Rails-Spotlight-Version'] = RailsSpotlight::VERSION unless skip?(request_path) end middleware.call(env) end |