mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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:
@@ -24,7 +24,7 @@ describe 'rate limiter integration' do
|
||||
}
|
||||
|
||||
expect(response.status).to eq(429)
|
||||
expect(response.headers['Retry-After']).to be > 29
|
||||
expect(response.headers['Retry-After'].to_i).to be > 29
|
||||
end
|
||||
|
||||
it "will not rate limit when all is good" do
|
||||
@@ -76,7 +76,7 @@ describe 'rate limiter integration' do
|
||||
|
||||
data = response.parsed_body
|
||||
|
||||
expect(response.headers['Retry-After']).to eq(60)
|
||||
expect(response.headers["Retry-After"]).to eq("60")
|
||||
expect(data["extras"]["wait_seconds"]).to eq(60)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user