Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
13bd7f52
Commit
13bd7f52
authored
Apr 15, 2021
by
Athar Hameed
Committed by
Etienne Baqué
Apr 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove :attachment_with_filename feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]
parent
0ad2e8fd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
36 deletions
+10
-36
app/helpers/workhorse_helper.rb
app/helpers/workhorse_helper.rb
+5
-7
changelogs/unreleased/323714-add-blob-filename-to-attachment-content-dispostion.yml
...14-add-blob-filename-to-attachment-content-dispostion.yml
+5
-0
config/feature_flags/development/attachment_with_filename.yml
...ig/feature_flags/development/attachment_with_filename.yml
+0
-8
spec/controllers/projects/design_management/designs/raw_images_controller_spec.rb
...s/design_management/designs/raw_images_controller_spec.rb
+0
-11
spec/support/shared_examples/controllers/snippet_blob_shared_examples.rb
...ared_examples/controllers/snippet_blob_shared_examples.rb
+0
-10
No files found.
app/helpers/workhorse_helper.rb
View file @
13bd7f52
...
...
@@ -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
.
nam
e
)
headers
[
'Content-Disposition'
]
=
content_disposition_for_blob
(
blob
,
inlin
e
)
# 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
changelogs/unreleased/323714-add-blob-filename-to-attachment-content-dispostion.yml
0 → 100644
View file @
13bd7f52
---
title
:
Add blob filename to attachment content disposition
merge_request
:
58977
author
:
type
:
added
config/feature_flags/development/attachment_with_filename.yml
deleted
100644 → 0
View file @
0ad2e8fd
---
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
spec/controllers/projects/design_management/designs/raw_images_controller_spec.rb
View file @
13bd7f52
...
...
@@ -45,17 +45,6 @@ RSpec.describe Projects::DesignManagement::Designs::RawImagesController do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
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
subject
...
...
spec/support/shared_examples/controllers/snippet_blob_shared_examples.rb
View file @
13bd7f52
...
...
@@ -36,16 +36,6 @@ RSpec.shared_examples 'raw snippet blob' do
expect
(
response
.
header
[
'Content-Disposition'
]).
to
match
"attachment; filename=
\"
#{
filepath
}
\"
"
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment