summaryrefslogtreecommitdiff
path: root/app/controllers/projects/artifacts_controller.rb
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-10-02 17:01:26 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-10-02 17:01:26 +0000
commit48c911b75e96563991387dc1c7b3aaa071d511cc (patch)
tree922137e8f162cf74b3965fc39ac1913b1049f0f5 /app/controllers/projects/artifacts_controller.rb
parentc0a982fad665e28769967b17eddd90900f62be78 (diff)
downloadgitlab-ce-48c911b75e96563991387dc1c7b3aaa071d511cc.tar.gz
CE Resolve "Refactor code quality similar to JUnit tests"
Diffstat (limited to 'app/controllers/projects/artifacts_controller.rb')
-rw-r--r--app/controllers/projects/artifacts_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb
index bd110d646e5..d0f59aa8162 100644
--- a/app/controllers/projects/artifacts_controller.rb
+++ b/app/controllers/projects/artifacts_controller.rb
@@ -14,6 +14,8 @@ class Projects::ArtifactsController < Projects::ApplicationController
before_action :entry, only: [:file]
def download
+ return render_404 unless artifacts_file
+
send_upload(artifacts_file, attachment: artifacts_file.filename)
end
@@ -100,7 +102,7 @@ class Projects::ArtifactsController < Projects::ApplicationController
# rubocop: enable CodeReuse/ActiveRecord
def artifacts_file
- @artifacts_file ||= build.artifacts_file
+ @artifacts_file ||= build.artifacts_file_for_type(params[:file_type] || :archive)
end
def entry