diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-15 21:09:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-15 21:09:01 +0300 |
commit | 74804f8c31491045b62a4b9fed9f819531462ea2 (patch) | |
tree | 87c58fb3a34d871e37ed0320a124c5b64f815334 /app/helpers | |
parent | 10130901f1128c91596c4cbfe14b1e5c9f15032f (diff) |
Add latest changes from gitlab-org/gitlab@master
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 |