diff options
Diffstat (limited to 'app/controllers/api_controller.rb')
-rw-r--r-- | app/controllers/api_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 862358d6e..d2d3bc4a4 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -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) @@ -59,7 +59,7 @@ class ApiController < ApplicationController end def current_resource_owner - User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token + @current_user ||= User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token end def current_user |