diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-25 18:20:47 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-25 18:20:47 +0100 |
commit | dda9ac9222811aec94c78da8318d64af3a3f215b (patch) | |
tree | 81ca85a4ae2eedabdd41ad5d4bd55eda5235a1c1 | |
parent | 4495baf4513cc4a07d077bf0081de686a3b7f985 (diff) |
Fix reset date format when rate limited
-rw-r--r-- | config/initializers/rack-attack.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/config/initializers/rack-attack.rb b/config/initializers/rack-attack.rb index 6d9286e66..0e96f5381 100644 --- a/config/initializers/rack-attack.rb +++ b/config/initializers/rack-attack.rb @@ -11,7 +11,7 @@ class Rack::Attack headers = { '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])).to_s + 'X-RateLimit-Reset' => (now + (match_data[:period] - now.to_i % match_data[:period])).iso8601(6) } [429, headers, [{ error: 'Throttled' }.to_json]] |