From dda9ac9222811aec94c78da8318d64af3a3f215b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 25 Nov 2016 18:20:47 +0100 Subject: [PATCH] Fix reset date format when rate limited --- config/initializers/rack-attack.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/rack-attack.rb b/config/initializers/rack-attack.rb index 6d9286e6687..0e96f5381ce 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]]