mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +00:00
Merge pull request #91 from gsamokovarov/call-responses
Invoke Rack:::{blacklisted,throttled}_response with #call
This commit is contained in:
commit
e7efe1cf5f
2 changed files with 4 additions and 4 deletions
|
|
@ -73,9 +73,9 @@ def call(env)
|
||||||
if whitelisted?(req)
|
if whitelisted?(req)
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
elsif blacklisted?(req)
|
elsif blacklisted?(req)
|
||||||
blacklisted_response[env]
|
self.class.blacklisted_response.call(env)
|
||||||
elsif throttled?(req)
|
elsif throttled?(req)
|
||||||
throttled_response[env]
|
self.class.throttled_response.call(env)
|
||||||
else
|
else
|
||||||
tracked?(req)
|
tracked?(req)
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
|
|
|
||||||
|
|
@ -96,9 +96,9 @@ class Rack::Attack
|
||||||
if whitelisted?(req)
|
if whitelisted?(req)
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
elsif blacklisted?(req)
|
elsif blacklisted?(req)
|
||||||
self.class.blacklisted_response[env]
|
self.class.blacklisted_response.call(env)
|
||||||
elsif throttled?(req)
|
elsif throttled?(req)
|
||||||
self.class.throttled_response[env]
|
self.class.throttled_response.call(env)
|
||||||
else
|
else
|
||||||
tracked?(req)
|
tracked?(req)
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue