]> cat aescling's git repositories - mastodon.git/commitdiff
X-RateLimit-Reset formatted with iso8601
authorEugen Rochko <eugen@zeonfederated.com>
Fri, 25 Nov 2016 14:21:22 +0000 (15:21 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 25 Nov 2016 14:21:22 +0000 (15:21 +0100)
app/controllers/api_controller.rb

index a3a2a3275d6cd7f130b7d49a2794ca87382a9fa9..d2d3bc4a4bb3e2bb55d1c989e211f49766495eec 100644 (file)
@@ -48,7 +48,7 @@ class ApiController < ApplicationController
 
     response.headers['X-RateLimit-Limit']     = match_data[:limit].to_s
     response.headers['X-RateLimit-Remaining'] = (match_data[:limit] - match_data[:count]).to_s
-    response.headers['X-RateLimit-Reset']     = (now + (match_data[:period] - now.to_i % match_data[:period])).to_s
+    response.headers['X-RateLimit-Reset']     = (now + (match_data[:period] - now.to_i % match_data[:period])).iso8601(6)
   end
 
   def set_pagination_headers(next_path = nil, prev_path = nil)