summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-06-02 04:24:57 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-06-02 04:24:57 +0800
commitb01bc0a0362fdc81f61941bee3b090267b6873c1 (patch)
tree45b6ea5e8714571aec1aa29957b92af43c547b88 /lib/api/helpers.rb
parentf62603286d72d42e5b4e87b8f7f7bd6094407f1b (diff)
parent1cd5c6d940baf5ee03e14ab924c4bb198aa04fd7 (diff)
downloadgitlab-ce-b01bc0a0362fdc81f61941bee3b090267b6873c1.tar.gz
Merge remote-tracking branch 'upstream/master' into 25680-CI_ENVIRONMENT_URL
* upstream/master: (39 commits) Resolve "Improve Container Registry description" Add username parameter to gravatar URL Fix replying to a commit discussion displayed in the context of an MR Add fog-aliyun as backup storage provider Add missing specs Make sure protected can't be null; Test protected! Update session cookie key name to be unique to instance in development Just mention which GitLab version is required Fix data inconsistency issue for old artifacts by moving them to a currently used path Fix N+1 queries for non-members in comment threads Fix rubocop in spec/helpers/diff_helper_spec.rb Merge two items into one in the doc Only remove FK if it exists Maintain notes avatar at smaller breakpoint Fix pipeline schedule value name in documentation Add test for Project#protected_for? Update diff discussion position per discussion instead of per note Display Shared Runner status in Admin Dashboard Make sure we're loading the fresh variables Now secret_variables_for would return the variables ...
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index d61450f8258..81f6fc3201d 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -311,6 +311,16 @@ module API
end
end
+ def present_artifacts!(artifacts_file)
+ return not_found! unless artifacts_file.exists?
+
+ if artifacts_file.file_storage?
+ present_file!(artifacts_file.path, artifacts_file.filename)
+ else
+ redirect_to(artifacts_file.url)
+ end
+ end
+
private
def private_token