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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
96d0b1c6
Commit
96d0b1c6
authored
Apr 12, 2018
by
Alexis Reigel
Committed by
Alexis Reigel
Jun 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
require uploaded file's name to match in any case
parent
256d9597
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
39 deletions
+59
-39
app/controllers/concerns/uploads_actions.rb
app/controllers/concerns/uploads_actions.rb
+5
-1
spec/controllers/uploads_controller_spec.rb
spec/controllers/uploads_controller_spec.rb
+54
-38
No files found.
app/controllers/concerns/uploads_actions.rb
View file @
96d0b1c6
...
@@ -31,13 +31,17 @@ module UploadsActions
...
@@ -31,13 +31,17 @@ module UploadsActions
disposition
=
uploader
.
image_or_video?
?
'inline'
:
'attachment'
disposition
=
uploader
.
image_or_video?
?
'inline'
:
'attachment'
if
uploader
.
filename
==
params
[
:filename
]
return
send_upload
(
uploader
,
attachment:
uploader
.
filename
,
disposition:
disposition
)
end
uploader_version
=
uploader
.
versions
.
values
.
find
{
|
version
|
version
.
filename
==
params
[
:filename
]
}
uploader_version
=
uploader
.
versions
.
values
.
find
{
|
version
|
version
.
filename
==
params
[
:filename
]
}
if
uploader_version
if
uploader_version
return
send_upload
(
uploader_version
,
attachment:
uploader_version
.
filename
,
disposition:
disposition
)
return
send_upload
(
uploader_version
,
attachment:
uploader_version
.
filename
,
disposition:
disposition
)
end
end
re
turn
send_upload
(
uploader
,
attachment:
uploader
.
filename
,
disposition:
disposition
)
re
nder_404
end
end
private
private
...
...
spec/controllers/uploads_controller_spec.rb
View file @
96d0b1c6
This diff is collapsed.
Click to expand it.
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