Skip to content

Commit 77195a5

Browse files
r-plussantib
andauthored
lowercase header key on README responder example for Rack 3 compatibility (#705)
Co-authored-by: Santiago Bartesaghi <sbartesaghi@hotmail.com>
1 parent 1155c26 commit 77195a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,9 @@ Rack::Attack.throttled_responder = lambda do |request|
356356
now = match_data[:epoch_time]
357357

358358
headers = {
359-
'RateLimit-Limit' => match_data[:limit].to_s,
360-
'RateLimit-Remaining' => '0',
361-
'RateLimit-Reset' => (now + (match_data[:period] - now % match_data[:period])).to_s
359+
'ratelimit-limit' => match_data[:limit].to_s,
360+
'ratelimit-remaining' => '0',
361+
'ratelimit-reset' => (now + (match_data[:period] - now % match_data[:period])).to_s
362362
}
363363

364364
[ 429, headers, ["Throttled\n"]]

0 commit comments

Comments
 (0)