summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 6134ad2bfc7..39547dabf15 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -426,13 +426,16 @@ module API
end
end
- def present_artifacts!(artifacts_file)
+ def present_artifacts!(artifacts_file, direct_download: true)
return not_found! unless artifacts_file.exists?
if artifacts_file.file_storage?
present_file!(artifacts_file.path, artifacts_file.filename)
- else
+ elsif direct_download
redirect_to(artifacts_file.url)
+ else
+ headers.store(*Gitlab::Workhorse.send_url(artifacts_file.url))
+ head :ok
end
end