提交 47bfd782 编写于 作者: R Rémy Coutable

Merge branch...

Merge branch 'blackst0ne-rails5-expected-the-response-to-have-status-code-ok-but-it-was-404' into 'master'

Resolve "[Rails5] expected the response to have status code :ok but it was 404"

Closes #48008

See merge request gitlab-org/gitlab-ce!19937
......@@ -7,6 +7,7 @@ class Projects::ArtifactsController < Projects::ApplicationController
before_action :authorize_read_build!
before_action :authorize_update_build!, only: [:keep]
before_action :extract_ref_name_and_path
before_action :set_request_format, only: [:file]
before_action :validate_artifacts!
before_action :entry, only: [:file]
......@@ -101,4 +102,12 @@ class Projects::ArtifactsController < Projects::ApplicationController
render_404 unless @entry.exists?
end
def set_request_format
request.format = :html if set_request_format?
end
def set_request_format?
request.format != :json
end
end
---
title: "[Rails5] Set request.format for artifacts_controller"
merge_request: 19937
author: "@blackst0ne"
type: fixed
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册