mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +00:00
Lower case headers. (#573)
This commit is contained in:
parent
d41abd7908
commit
933c0576b8
1 changed files with 3 additions and 3 deletions
|
|
@ -5,7 +5,7 @@ require "ipaddr"
|
||||||
module Rack
|
module Rack
|
||||||
class Attack
|
class Attack
|
||||||
class Configuration
|
class Configuration
|
||||||
DEFAULT_BLOCKLISTED_RESPONDER = lambda { |_req| [403, { 'Content-Type' => 'text/plain' }, ["Forbidden\n"]] }
|
DEFAULT_BLOCKLISTED_RESPONDER = lambda { |_req| [403, { 'content-type' => 'text/plain' }, ["Forbidden\n"]] }
|
||||||
|
|
||||||
DEFAULT_THROTTLED_RESPONDER = lambda do |req|
|
DEFAULT_THROTTLED_RESPONDER = lambda do |req|
|
||||||
if Rack::Attack.configuration.throttled_response_retry_after_header
|
if Rack::Attack.configuration.throttled_response_retry_after_header
|
||||||
|
|
@ -13,9 +13,9 @@ module Rack
|
||||||
now = match_data[:epoch_time]
|
now = match_data[:epoch_time]
|
||||||
retry_after = match_data[:period] - (now % match_data[:period])
|
retry_after = match_data[:period] - (now % match_data[:period])
|
||||||
|
|
||||||
[429, { 'Content-Type' => 'text/plain', 'Retry-After' => retry_after.to_s }, ["Retry later\n"]]
|
[429, { 'content-type' => 'text/plain', 'retry-after' => retry_after.to_s }, ["Retry later\n"]]
|
||||||
else
|
else
|
||||||
[429, { 'Content-Type' => 'text/plain' }, ["Retry later\n"]]
|
[429, { 'content-type' => 'text/plain' }, ["Retry later\n"]]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue