mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +00:00
Merge pull request #5 from barelyknown/master
Fixed syntax error in response example
This commit is contained in:
commit
234a2cff6c
1 changed files with 2 additions and 2 deletions
|
|
@ -125,11 +125,11 @@ A [Rack::Request](http://rack.rubyforge.org/doc/classes/Rack/Request.html) objec
|
||||||
|
|
||||||
Customize the response of blacklisted and throttled requests using an object that adheres to the [Rack app interface](http://rack.rubyforge.org/doc/SPEC.html).
|
Customize the response of blacklisted and throttled requests using an object that adheres to the [Rack app interface](http://rack.rubyforge.org/doc/SPEC.html).
|
||||||
|
|
||||||
Rack:Attack.blacklisted_response = lambda do |env|
|
Rack::Attack.blacklisted_response = lambda do |env|
|
||||||
[ 503, {}, ['Blocked']]
|
[ 503, {}, ['Blocked']]
|
||||||
end
|
end
|
||||||
|
|
||||||
Rack:Attack.throttled_response = lambda do |env|
|
Rack::Attack.throttled_response = lambda do |env|
|
||||||
# name and other data about the matched throttle
|
# name and other data about the matched throttle
|
||||||
body = [
|
body = [
|
||||||
env['rack.attack.matched'],
|
env['rack.attack.matched'],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue