0
0
Fork 0

Autofix Rubocop cops for config/ (#24145)

This commit is contained in:
Nick Schonning 2023-10-03 09:24:12 -04:00 committed by GitHub
parent e715da6d25
commit 85db392464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 43 additions and 69 deletions

View file

@ -142,10 +142,10 @@ class Rack::Attack
match_data = request.env['rack.attack.match_data']
headers = {
'Content-Type' => 'application/json',
'X-RateLimit-Limit' => match_data[:limit].to_s,
'Content-Type' => 'application/json',
'X-RateLimit-Limit' => match_data[:limit].to_s,
'X-RateLimit-Remaining' => '0',
'X-RateLimit-Reset' => (now + (match_data[:period] - (now.to_i % match_data[:period]))).iso8601(6),
'X-RateLimit-Reset' => (now + (match_data[:period] - (now.to_i % match_data[:period]))).iso8601(6),
}
[429, headers, [{ error: I18n.t('errors.429') }.to_json]]