Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Wrap error only when Rails.application.config.consider_all_requests_local false

Oliver Günther8151497ed062
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index edb40d823c0..1d470310bd4 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -125,6 +125,11 @@ class ApplicationController < ActionController::Base
rescue_from StandardError do |exception|
render_500 exception:
end
+
+ rescue_from ActionController::UnknownFormat do
+ render body: "406 Not Acceptable: invalid request format",
+ status: :not_acceptable
+ end
end
rescue_from ActionController::ParameterMissing do |exception|
@@ -132,11 +137,6 @@ class ApplicationController < ActionController::Base
status: :bad_request
end
- rescue_from ActionController::UnknownFormat do
- render body: "Invalid request format",
- status: :not_acceptable
- end
-
rescue_from ActiveRecord::ConnectionTimeoutError do |exception|
render_500 exception:,
payload: ::OpenProject::Logging::ThreadPoolContextBuilder.build!