Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-06-18 12:22:57 +0300
committerRémy Coutable <remy@rymai.me>2018-06-18 12:22:57 +0300
commit47bfd782bdad9a021ae3241825c9538d42eee7a4 (patch)
tree89e2411afe981573999d66b7057707f2eb20ed4f /app/controllers/projects
parent95753b5ec7050b2d7c9848546a0802bcff0702b6 (diff)
parentc48e7dc2633f8ee8f38150b050938f43e75bd207 (diff)
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
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/artifacts_controller.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb
index abc283d7aa9..6484a713f8e 100644
--- a/app/controllers/projects/artifacts_controller.rb
+++ b/app/controllers/projects/artifacts_controller.rb
@@ -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