about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-25 18:20:47 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-25 18:20:47 +0100
commitdda9ac9222811aec94c78da8318d64af3a3f215b (patch)
tree81ca85a4ae2eedabdd41ad5d4bd55eda5235a1c1 /config
parent4495baf4513cc4a07d077bf0081de686a3b7f985 (diff)
Fix reset date format when rate limited
Diffstat (limited to 'config')
-rw-r--r--config/initializers/rack-attack.rb2
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]]