mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
parent
1fbcb479f1
commit
6f7bd66dfa
2 changed files with 3 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# Changlog
|
||||
|
||||
## master (unreleased)
|
||||
- Default throttled/blacklist responses have Content-Type: text/plain
|
||||
- Rack::Attack.clear! resets tracks
|
||||
|
||||
## v4.0.1 - 14 May 2014
|
||||
|
|
|
|||
|
|
@ -80,10 +80,10 @@ class Rack::Attack
|
|||
|
||||
# Set defaults
|
||||
@notifier = ActiveSupport::Notifications if defined?(ActiveSupport::Notifications)
|
||||
@blacklisted_response = lambda {|env| [403, {}, ["Forbidden\n"]] }
|
||||
@blacklisted_response = lambda {|env| [403, {'Content-Type' => 'text/plain'}, ["Forbidden\n"]] }
|
||||
@throttled_response = lambda {|env|
|
||||
retry_after = env['rack.attack.match_data'][:period] rescue nil
|
||||
[429, {'Retry-After' => retry_after.to_s}, ["Retry later\n"]]
|
||||
[429, {'Content-Type' => 'text/plain', 'Retry-After' => retry_after.to_s}, ["Retry later\n"]]
|
||||
}
|
||||
|
||||
def initialize(app)
|
||||
|
|
|
|||
Loading…
Reference in a new issue