diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-11-07 16:54:37 +0100 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-11-07 21:49:45 +0100 |
commit | 5da2f42dc9609c07fd60d9d1c7a2302353a820c0 (patch) | |
tree | 79d13b23dfdca03f6bcccc4a1ba5c7574df1b145 /app | |
parent | 829e452588575c634b2a3dd778e702a6b21465e1 (diff) | |
download | gitlab-ce-always-proxy-reports.tar.gz |
backport: Always proxy reports downloadsalways-proxy-reports
This makes to always proxy reports
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/concerns/send_file_upload.rb | 4 | ||||
-rw-r--r-- | app/controllers/projects/artifacts_controller.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/concerns/send_file_upload.rb b/app/controllers/concerns/send_file_upload.rb index 0bb7b7efed0..515a9eede8e 100644 --- a/app/controllers/concerns/send_file_upload.rb +++ b/app/controllers/concerns/send_file_upload.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module SendFileUpload - def send_upload(file_upload, send_params: {}, redirect_params: {}, attachment: nil, disposition: 'attachment') + def send_upload(file_upload, send_params: {}, redirect_params: {}, attachment: nil, proxy: false, disposition: 'attachment') if attachment # Response-Content-Type will not override an existing Content-Type in # Google Cloud Storage, so the metadata needs to be cleared on GCS for @@ -17,7 +17,7 @@ module SendFileUpload if file_upload.file_storage? send_file file_upload.path, send_params - elsif file_upload.class.proxy_download_enabled? + elsif file_upload.class.proxy_download_enabled? || proxy headers.store(*Gitlab::Workhorse.send_url(file_upload.url(**redirect_params))) head :ok else diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb index 312e256ea6c..ae9c17802b9 100644 --- a/app/controllers/projects/artifacts_controller.rb +++ b/app/controllers/projects/artifacts_controller.rb @@ -16,7 +16,7 @@ class Projects::ArtifactsController < Projects::ApplicationController def download return render_404 unless artifacts_file - send_upload(artifacts_file, attachment: artifacts_file.filename) + send_upload(artifacts_file, attachment: artifacts_file.filename, proxy: params[:proxy]) end def browse |