summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-05 11:16:49 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-05 11:16:49 +0200
commitdfb8fcbb651812d209d2f42baf6c2bb0e851c861 (patch)
tree5a41087e6808929315ca10ca5c9b3ea2c01a44b5 /lib/api
parent83600e94262c1fadae98f1e0709f2430aaea03b7 (diff)
downloadgitlab-ce-dfb8fcbb651812d209d2f42baf6c2bb0e851c861.tar.gz
Use API helper to send artifact file through Workhorse
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/helpers.rb4
-rw-r--r--lib/api/jobs.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 3d377fdb9eb..f9ce1165544 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -432,6 +432,10 @@ module API
header(*Gitlab::Workhorse.send_git_archive(repository, ref: ref, format: format))
end
+ def send_artifacts_entry(build, entry)
+ header(*Gitlab::Workhorse.send_artifacts_entry(build, entry))
+ end
+
# The Grape Error Middleware only has access to env but no params. We workaround this by
# defining a method that returns the right value.
def define_params_for_grape_middleware
diff --git a/lib/api/jobs.rb b/lib/api/jobs.rb
index 41b3b28037c..41c70a2dcb7 100644
--- a/lib/api/jobs.rb
+++ b/lib/api/jobs.rb
@@ -101,7 +101,7 @@ module API
entry = build.artifacts_metadata_entry(params[:artifact_path])
not_found! unless entry.exists?
- Gitlab::Workhorse.send_artifacts_entry(build, entry)
+ send_artifacts_entry(build, entry)
end
desc 'Download the artifacts file from a job' do