Skip to content

Commit

Permalink
Demonstrate that the correct Illustrator content type is chosen regar…
Browse files Browse the repository at this point in the history
…dless of declared type when the filename extension results in a more specific subtype of the PDF type sniffed from magic bytes
  • Loading branch information
jeremy committed Mar 1, 2024
1 parent cdf0e65 commit 36a94f2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/illustrator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,14 @@ class Marcel::MimeType::IllustratorTest < Marcel::TestCase
file = files("name/application/illustrator/illustrator.ai")
assert_equal "application/illustrator", Marcel::MimeType.for(file, name: "illustrator.ai", declared_type: "application/postscript")
end

test ".ai uploaded as application/pdf" do
file = files("name/application/illustrator/illustrator.ai")
assert_equal "application/illustrator", Marcel::MimeType.for(file, name: "illustrator.ai", declared_type: "application/pdf")
end

test ".ai uploaded as binary" do
file = files("name/application/illustrator/illustrator.ai")
assert_equal "application/illustrator", Marcel::MimeType.for(file, name: "illustrator.ai", declared_type: "application/octet-stream")
end
end

0 comments on commit 36a94f2

Please sign in to comment.