Revert "[Rails5] Set request.format in commits_controller"

This reverts commit 6da1941553.

# Conflicts:
#	app/controllers/projects/commits_controller.rb
This commit is contained in:
Douwe Maan 2018-11-30 12:55:04 +01:00
parent 16f7243fef
commit 19ad2a4987
No known key found for this signature in database
GPG Key ID: 5976703F65143D36
1 changed files with 0 additions and 14 deletions

View File

@ -12,7 +12,6 @@ class Projects::CommitsController < Projects::ApplicationController
before_action :assign_ref_vars, except: :commits_root
before_action :authorize_download_code!
before_action :set_commits, except: :commits_root
before_action :set_request_format, only: :show
def commits_root
redirect_to project_commits_path(@project, @project.default_branch)
@ -71,19 +70,6 @@ class Projects::CommitsController < Projects::ApplicationController
@commits = set_commits_for_rendering(@commits)
end
# Rails 5 sets request.format from the extension.
# Explicitly set to :html.
def set_request_format
request.format = :html if set_request_format?
end
# Rails 5 sets request.format from extension.
# In this case if the ref ends with `.atom`, it's expected to be the html response,
# not the atom one. So explicitly set request.format as :html to act like rails4.
def set_request_format?
request.format.to_s == "text/html" || @commits.ref.ends_with?("atom")
end
def whitelist_query_limiting
Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42330')
end