Commit 14e81769 authored by Vasilii Iakliushin's avatar Vasilii Iakliushin

Remove unnecessary html respond

* Contributes to https://gitlab.com/gitlab-org/gitlab/-/issues/351520
* Sentry error:
https://sentry.gitlab.net/gitlab/gitlabcom/issues/3237376

**Problem**

Double call of respond_to causes
ActionController::RespondToMismatchError

**Solution**

We already render 404 page for missing formats, because of that we can
remove unnecessary responder.

Changelog: changed
parent 39da3930
......@@ -43,12 +43,7 @@ class Projects::RefsController < Projects::ApplicationController
end
def logs_tree
tree_summary = ::Gitlab::TreeSummary.new(
@commit, @project, current_user,
path: @path, offset: permitted_params[:offset], limit: 25)
respond_to do |format|
format.html { render_404 }
format.json do
logs, next_offset = tree_summary.fetch_logs
......@@ -61,6 +56,13 @@ class Projects::RefsController < Projects::ApplicationController
private
def tree_summary
::Gitlab::TreeSummary.new(
@commit, @project, current_user,
path: @path, offset: permitted_params[:offset], limit: 25
)
end
def validate_ref_id
return not_found if permitted_params[:id].present? && permitted_params[:id] !~ Gitlab::PathRegex.git_reference_regex
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment