Merge pull request #91 from gsamokovarov/call-responses

Invoke Rack:::{blacklisted,throttled}_response with #call
This commit is contained in:
Aaron Suggs 2014-10-02 14:25:42 -04:00
commit e7efe1cf5f
2 changed files with 4 additions and 4 deletions

View file

@ -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)

View file

@ -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)