From 933c0576b8ab1b398d627f87aef24585fe263135 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Sat, 19 Feb 2022 13:56:02 +1300 Subject: [PATCH] Lower case headers. (#573) --- lib/rack/attack/configuration.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rack/attack/configuration.rb b/lib/rack/attack/configuration.rb index ba353ab4..c90fdee6 100644 --- a/lib/rack/attack/configuration.rb +++ b/lib/rack/attack/configuration.rb @@ -5,7 +5,7 @@ module Rack class Attack 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| if Rack::Attack.configuration.throttled_response_retry_after_header @@ -13,9 +13,9 @@ class Configuration now = match_data[:epoch_time] 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 - [429, { 'Content-Type' => 'text/plain' }, ["Retry later\n"]] + [429, { 'content-type' => 'text/plain' }, ["Retry later\n"]] end end