summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-06-01 15:43:35 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2017-06-01 15:43:35 +0000
commitaff097e8f528ab5b00842df7c76d3435b1e59c96 (patch)
treeb670c73655233e27df63b80111f606770d29b412 /lib/api/helpers.rb
parent6f14a3ea6ba711259dc1ae4da374d032ca49ad17 (diff)
parent6185d12c183b539ea06ab3550b2c21045d169ca4 (diff)
downloadgitlab-ce-aff097e8f528ab5b00842df7c76d3435b1e59c96.tar.gz
Merge branch 'migrate-old-artifacts' into 'master'
Fix data inconsistency issue for old artifacts by moving them to a currently used path Closes #32036 See merge request !11824
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