diff options
author | Kia Mei Somabes <kssomabes@up.edu.ph> | 2018-07-13 04:24:11 +0300 |
---|---|---|
committer | Kia Mei Somabes <kssomabes@up.edu.ph> | 2018-07-13 04:33:35 +0300 |
commit | 1e0f0de30253cf20533fe4002272e3e3861b3883 (patch) | |
tree | 86a51b02976b9469066a0a46ad8b90a5c6f16cdd /app/helpers/workhorse_helper.rb | |
parent | 9f57ae11e935d2a8a2b175d8382ed87020727845 (diff) |
Refactor code 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 980d07c8800..fd1d78bd9b8 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, inline) + def send_git_blob(repository, blob, inline: true) headers.store(*Gitlab::Workhorse.send_git_blob(repository, blob)) - inline ? (headers['Content-Disposition'] = 'inline') : (headers['Content-Disposition'] = 'attachment') + headers['Content-Disposition'] = inline ? 'inline' : 'attachment' headers['Content-Type'] = safe_content_type(blob) render plain: "" end |