Skip to content

Commit 933c057

Browse files
authored
Lower case headers. (#573)
1 parent d41abd7 commit 933c057

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/rack/attack/configuration.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
module Rack
66
class Attack
77
class Configuration
8-
DEFAULT_BLOCKLISTED_RESPONDER = lambda { |_req| [403, { 'Content-Type' => 'text/plain' }, ["Forbidden\n"]] }
8+
DEFAULT_BLOCKLISTED_RESPONDER = lambda { |_req| [403, { 'content-type' => 'text/plain' }, ["Forbidden\n"]] }
99

1010
DEFAULT_THROTTLED_RESPONDER = lambda do |req|
1111
if Rack::Attack.configuration.throttled_response_retry_after_header
1212
match_data = req.env['rack.attack.match_data']
1313
now = match_data[:epoch_time]
1414
retry_after = match_data[:period] - (now % match_data[:period])
1515

16-
[429, { 'Content-Type' => 'text/plain', 'Retry-After' => retry_after.to_s }, ["Retry later\n"]]
16+
[429, { 'content-type' => 'text/plain', 'retry-after' => retry_after.to_s }, ["Retry later\n"]]
1717
else
18-
[429, { 'Content-Type' => 'text/plain' }, ["Retry later\n"]]
18+
[429, { 'content-type' => 'text/plain' }, ["Retry later\n"]]
1919
end
2020
end
2121

0 commit comments

Comments
 (0)