Merge pull request #575 from sixpark/adriancb/update_readme

fix(documentation): Updating README with non-deprecated configuration.
This commit is contained in:
Gonzalo 2022-03-19 22:19:11 -03:00 committed by GitHub
commit b0be38334a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -347,8 +347,8 @@ Rack::Attack.throttled_response_retry_after_header = true
Here's an example response that includes conventional `RateLimit-*` headers:
```ruby
Rack::Attack.throttled_response = lambda do |env|
match_data = env['rack.attack.match_data']
Rack::Attack.throttled_responder = lambda do |request|
match_data = request.env['rack.attack.match_data']
now = match_data[:epoch_time]
headers = {