diff options
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index cc81e4d3595..d4ca945873c 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -418,13 +418,17 @@ 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(artifacts_file.url) + else + header(*Gitlab::Workhorse.send_url(artifacts_file.url)) + status :ok + body end end |