diff options
author | Kia Mei Somabes <kssomabes@up.edu.ph> | 2018-07-12 10:23:00 +0800 |
---|---|---|
committer | Kia Mei Somabes <kssomabes@up.edu.ph> | 2018-07-12 10:23:00 +0800 |
commit | 9f57ae11e935d2a8a2b175d8382ed87020727845 (patch) | |
tree | 87a309a07ce9f1765700bdd062544cb3c9acc398 /app/helpers/workhorse_helper.rb | |
parent | 50c128944e5e65fb5124aeb790cc0f1ec06049d3 (diff) | |
download | gitlab-ce-9f57ae11e935d2a8a2b175d8382ed87020727845.tar.gz |
Set content-disposition header for single file download in repository
Diffstat (limited to 'app/helpers/workhorse_helper.rb')
-rw-r--r-- | app/helpers/workhorse_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/workhorse_helper.rb b/app/helpers/workhorse_helper.rb index a82271ce0ee..980d07c8800 100644 --- a/app/helpers/workhorse_helper.rb +++ b/app/helpers/workhorse_helper.rb @@ -2,9 +2,9 @@ # Workhorse will also serve files when using `send_file`. module WorkhorseHelper # Send a Git blob through Workhorse - def send_git_blob(repository, blob) + def send_git_blob(repository, blob, inline) headers.store(*Gitlab::Workhorse.send_git_blob(repository, blob)) - headers['Content-Disposition'] = 'inline' + inline ? (headers['Content-Disposition'] = 'inline') : (headers['Content-Disposition'] = 'attachment') headers['Content-Type'] = safe_content_type(blob) render plain: "" end |