openstreetmap-website/app/controllers/api/versions_controller.rb
Andy Allan 83425edd8d Move api error handling and timeouts to parent class
Fixes #4861

Since the around_action is defined before authorize_resource is called,
the handler needs to pass on the CanCan::AccessDenied exception.

I've added the timeouts where I think they were missing (e.g. UserPreferencesController)
but I've kept the exception for changeset#upload and traces#create
2024-10-02 16:37:32 +01:00

16 lines
484 B
Ruby

module Api
class VersionsController < ApiController
skip_before_action :check_api_readable
authorize_resource :class => false
before_action :set_request_formats
# Show the list of available API versions. This will replace the global
# unversioned capabilities call in due course.
# Currently we only support deploying one version at a time, but this will
# hopefully change soon.
def show
@versions = [Settings.api_version]
end
end
end