app/controllers/openstax/api/v1/api_controller.rb in openstax_api-5.2.1 vs app/controllers/openstax/api/v1/api_controller.rb in openstax_api-5.2.2
- old
+ new
@@ -11,10 +11,12 @@
before_action :doorkeeper_authorize!, :unless => :session_user?
skip_before_filter :verify_authenticity_token, :unless => :session_user?
respond_to :json
+ after_filter :set_date_header
+
# Keep old current_user method so we can use it
alias_method :current_session_user,
OpenStax::Api.configuration.current_user_method
# Ensure we will never again confuse human users and api users
@@ -44,10 +46,14 @@
def session_user?
!!current_session_user && doorkeeper_token.blank?
end
+ def set_date_header
+ response.date = Time.now unless response.date?
+ end
+
end
end
end
-end
\ No newline at end of file
+end