Commit 13bd7f52 authored by Athar Hameed's avatar Athar Hameed Committed by Etienne Baqué

Remove :attachment_with_filename feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

parent 0ad2e8fd
...@@ -7,7 +7,7 @@ module WorkhorseHelper ...@@ -7,7 +7,7 @@ module WorkhorseHelper
def send_git_blob(repository, blob, inline: true) def send_git_blob(repository, blob, inline: true)
headers.store(*Gitlab::Workhorse.send_git_blob(repository, blob)) 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 # If enabled, this will override the values set above
workhorse_set_content_type! workhorse_set_content_type!
...@@ -49,11 +49,9 @@ module WorkhorseHelper ...@@ -49,11 +49,9 @@ module WorkhorseHelper
headers[Gitlab::Workhorse::DETECT_HEADER] = "true" headers[Gitlab::Workhorse::DETECT_HEADER] = "true"
end end
def content_disposition_attachment(project, filename) def content_disposition_for_blob(blob, inline)
if Feature.enabled?(:attachment_with_filename, project, default_enabled: :yaml) return 'inline' if inline
ActionDispatch::Http::ContentDisposition.format(disposition: 'attachment', filename: filename)
else ActionDispatch::Http::ContentDisposition.format(disposition: 'attachment', filename: blob.name)
'attachment'
end
end end
end end
---
title: Add blob filename to attachment content disposition
merge_request: 58977
author:
type: added
---
name: attachment_with_filename
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55066
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/323714
milestone: '13.10'
type: development
group: group::editor
default_enabled: false
...@@ -45,17 +45,6 @@ RSpec.describe Projects::DesignManagement::Designs::RawImagesController do ...@@ -45,17 +45,6 @@ RSpec.describe Projects::DesignManagement::Designs::RawImagesController do
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end end
context 'when the feature flag attachment_with_filename is disabled' do
it 'serves files with just `attachment` in the disposition header' do
stub_feature_flags(attachment_with_filename: false)
subject
expect(response.header['Content-Disposition']).to eq('attachment')
expect(response).to have_gitlab_http_status(:ok)
end
end
it 'serves files with Workhorse' do it 'serves files with Workhorse' do
subject subject
......
...@@ -36,16 +36,6 @@ RSpec.shared_examples 'raw snippet blob' do ...@@ -36,16 +36,6 @@ RSpec.shared_examples 'raw snippet blob' do
expect(response.header['Content-Disposition']).to match "attachment; filename=\"#{filepath}\"" expect(response.header['Content-Disposition']).to match "attachment; filename=\"#{filepath}\""
end end
context 'when the feature flag attachment_with_filename is disabled' do
it 'returns just attachment in the disposition header' do
stub_feature_flags(attachment_with_filename: false)
subject
expect(response.header['Content-Disposition']).to eq 'attachment'
end
end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment