lib/rack/traffic_signal/middleware.rb in rack-traffic-signal-0.1.3 vs lib/rack/traffic_signal/middleware.rb in rack-traffic-signal-0.1.4
- old
+ new
@@ -6,18 +6,18 @@
def initialize(app)
@app = app
end
def call(env)
- return @app.call(env) if config.skip?(env)
+ return @app.call(env) if Rack::TrafficSignal.skip?(env)
method = env['REQUEST_METHOD'].downcase.to_sym
path = env['PATH_INFO']
path = path.chop if path != '/' && path[-1] == '/'
applied_config = maintenance_application(method, path)
if applied_config
- if config.skip_with_warning?(env)
+ if Rack::TrafficSignal.skip_with_warning?(env)
@app.call(env).tap do |status, headers, body|
headers['X-RACK-TRAFFIC-SIGNAL-MAINTENENCE'] = '1'
end
else
build_response(applied_config)
\ No newline at end of file