diff options
author | Micaël Bergeron <mbergeron@gitlab.com> | 2018-03-09 09:16:06 -0500 |
---|---|---|
committer | Micaël Bergeron <mbergeron@gitlab.com> | 2018-03-09 09:16:06 -0500 |
commit | fc6587f1f21c97fa19e3ae7eaac4e9add7b107b8 (patch) | |
tree | d83947812fb500e5f437a0d672901861dae5a13e /app/controllers/concerns/uploads_actions.rb | |
parent | 6466739e2e61f790a9e1f09020dba710c4078a0f (diff) | |
download | gitlab-ce-fc6587f1f21c97fa19e3ae7eaac4e9add7b107b8.tar.gz |
Add proxy_download to perform proxied sending of all files
Diffstat (limited to 'app/controllers/concerns/uploads_actions.rb')
-rw-r--r-- | app/controllers/concerns/uploads_actions.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/app/controllers/concerns/uploads_actions.rb b/app/controllers/concerns/uploads_actions.rb index f4e19615760..b9b9b6e4e88 100644 --- a/app/controllers/concerns/uploads_actions.rb +++ b/app/controllers/concerns/uploads_actions.rb @@ -1,5 +1,6 @@ module UploadsActions include Gitlab::Utils::StrongMemoize + include SendFileUpload UPLOAD_MOUNTS = %w(avatar attachment file logo header_logo).freeze @@ -26,14 +27,11 @@ module UploadsActions def show return render_404 unless uploader&.exists? - if uploader.file_storage? - disposition = uploader.image_or_video? ? 'inline' : 'attachment' - expires_in 0.seconds, must_revalidate: true, private: true + expires_in 0.seconds, must_revalidate: true, private: true - send_file uploader.file.path, disposition: disposition - else - redirect_to uploader.url - end + disposition = uploader.image_or_video? ? 'inline' : 'attachment' + + send_upload(uploader, attachment: uploader.filename, disposition: disposition) end private |