gearheads
/
mastodon
Archived
2
0
Fork 0

Fix reset date format when rate limited

gh/stable
Eugen Rochko 2016-11-25 18:20:47 +01:00
parent 4495baf451
commit dda9ac9222
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ class Rack::Attack
headers = { headers = {
'X-RateLimit-Limit' => match_data[:limit].to_s, 'X-RateLimit-Limit' => match_data[:limit].to_s,
'X-RateLimit-Remaining' => '0', 'X-RateLimit-Remaining' => '0',
'X-RateLimit-Reset' => (now + (match_data[:period] - now.to_i % match_data[:period])).to_s 'X-RateLimit-Reset' => (now + (match_data[:period] - now.to_i % match_data[:period])).iso8601(6)
} }
[429, headers, [{ error: 'Throttled' }.to_json]] [429, headers, [{ error: 'Throttled' }.to_json]]