Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
ea142d80
Commit
ea142d80
authored
Mar 11, 2015
by
pierallard
Committed by
Jon Yurek
Apr 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allows multiple content types for spoof detector
parent
f55b9565
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
+11
-1
lib/paperclip/media_type_spoof_detector.rb
+1
-1
spec/paperclip/media_type_spoof_detector_spec.rb
+10
-0
No files found.
lib/paperclip/media_type_spoof_detector.rb
View file @
ea142d80
...
...
@@ -31,7 +31,7 @@ module Paperclip
end
def
mapping_override_mismatch?
mapped_content_type
!=
calculated_content_type
!
Array
(
mapped_content_type
).
include?
(
calculated_content_type
)
end
def
supplied_file_media_types
...
...
spec/paperclip/media_type_spoof_detector_spec.rb
View file @
ea142d80
...
...
@@ -43,4 +43,14 @@ describe Paperclip::MediaTypeSpoofDetector do
Paperclip
.
options
[
:content_type_mappings
]
=
{}
end
end
it
'doest allow array as :content_type_mappings'
do
begin
Paperclip
.
options
[
:content_type_mappings
]
=
{
html:
[
"binary"
,
"text/html"
]
}
file
=
File
.
open
(
fixture_file
(
"empty.html"
))
assert
!
Paperclip
::
MediaTypeSpoofDetector
.
using
(
file
,
"empty.html"
).
spoofed?
ensure
Paperclip
.
options
[
:content_type_mappings
]
=
{}
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