diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 11:33:21 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 11:33:21 +0000 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /app/controllers/concerns/send_file_upload.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) | |
download | gitlab-ce-7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0.tar.gz |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'app/controllers/concerns/send_file_upload.rb')
-rw-r--r-- | app/controllers/concerns/send_file_upload.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/controllers/concerns/send_file_upload.rb b/app/controllers/concerns/send_file_upload.rb index c8369c465b8..c91edb74d6b 100644 --- a/app/controllers/concerns/send_file_upload.rb +++ b/app/controllers/concerns/send_file_upload.rb @@ -30,7 +30,17 @@ module SendFileUpload headers.store(*Gitlab::Workhorse.send_url(file_upload.url(**redirect_params))) head :ok else - redirect_to file_upload.url(**redirect_params) + redirect_to cdn_fronted_url(file_upload, redirect_params) + end + end + + def cdn_fronted_url(file, redirect_params) + if file.respond_to?(:cdn_enabled_url) + result = file.cdn_enabled_url(request.remote_ip, redirect_params[:query]) + Gitlab::ApplicationContext.push(artifact_used_cdn: result.used_cdn) + result.url + else + file.url(**redirect_params) end end |