mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 01:15:26 +08:00
DEV: Retry-after header values should be strings (#12475)
Fixes `Rack::Lint::LintError: a header value must be a String, but the value of 'Retry-After' is a Integer`. (see: 14a236b4f0/lib/rack/lint.rb (L676)
)
I found it when I got flooded by those warning a while back in a test-related accident 😉 (ember CLI tests were hitting a local rails server at a fast rate)
This commit is contained in:
@ -166,7 +166,7 @@ class Middleware::RequestTracker
|
||||
if available_in = rate_limit(request)
|
||||
return [
|
||||
429,
|
||||
{ "Retry-After" => available_in },
|
||||
{ "Retry-After" => available_in.to_s },
|
||||
["Slow down, too many requests from this IP address"]
|
||||
]
|
||||
end
|
||||
|
Reference in New Issue
Block a user