diff options
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/sidebars_helper.rb | 3 | ||||
-rw-r--r-- | app/helpers/workhorse_helper.rb | 12 |
2 files changed, 7 insertions, 8 deletions
diff --git a/app/helpers/sidebars_helper.rb b/app/helpers/sidebars_helper.rb index efb0fd8a6e3..b0fffe93c25 100644 --- a/app/helpers/sidebars_helper.rb +++ b/app/helpers/sidebars_helper.rb @@ -35,7 +35,8 @@ module SidebarsHelper def project_sidebar_context_data(project, user) { current_user: user, - container: project + container: project, + learn_gitlab_experiment_enabled: learn_gitlab_experiment_enabled?(project) } end end 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 |