summaryrefslogtreecommitdiff
path: root/app/helpers/workhorse_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/workhorse_helper.rb')
-rw-r--r--app/helpers/workhorse_helper.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/helpers/workhorse_helper.rb b/app/helpers/workhorse_helper.rb
index 28dd1b00292..8785c4cdcbb 100644
--- a/app/helpers/workhorse_helper.rb
+++ b/app/helpers/workhorse_helper.rb
@@ -7,7 +7,7 @@ module WorkhorseHelper
def send_git_blob(repository, blob, inline: true)
headers.store(*Gitlab::Workhorse.send_git_blob(repository, blob))
- headers['Content-Disposition'] = inline ? 'inline' : content_disposition_attachment(repository.project, blob.name)
+ headers['Content-Disposition'] = content_disposition_for_blob(blob, inline)
# If enabled, this will override the values set above
workhorse_set_content_type!
@@ -49,11 +49,9 @@ module WorkhorseHelper
headers[Gitlab::Workhorse::DETECT_HEADER] = "true"
end
- def content_disposition_attachment(project, filename)
- if Feature.enabled?(:attachment_with_filename, project, default_enabled: :yaml)
- ActionDispatch::Http::ContentDisposition.format(disposition: 'attachment', filename: filename)
- else
- 'attachment'
- end
+ def content_disposition_for_blob(blob, inline)
+ return 'inline' if inline
+
+ ActionDispatch::Http::ContentDisposition.format(disposition: 'attachment', filename: blob.name)
end
end