From 74804f8c31491045b62a4b9fed9f819531462ea2 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 15 Apr 2021 18:09:01 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/helpers/workhorse_helper.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'app/helpers/workhorse_helper.rb') 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 -- cgit v1.2.3