Bypass the filter based on content-type as well in case a webp image is uploaded with the wrong file extension.
This commit is contained in:
parent
3a98960c26
commit
216c84a8f4
2 changed files with 11 additions and 4 deletions
|
|
@ -34,11 +34,15 @@ defmodule Pleroma.Upload.Filter.ExiftoolTest do
|
|||
test "verify webp files are skipped" do
|
||||
upload = %Pleroma.Upload{
|
||||
name: "sample.webp",
|
||||
content_type: "image/webp",
|
||||
path: Path.absname("/dev/null"),
|
||||
tempfile: Path.absname("/dev/null")
|
||||
content_type: "image/webp"
|
||||
}
|
||||
|
||||
bad_type = %Pleroma.Upload{
|
||||
name: "sample.webp",
|
||||
content_type: "image/jpeg"
|
||||
}
|
||||
|
||||
assert Filter.Exiftool.filter(upload) == {:ok, :noop}
|
||||
assert Filter.Exiftool.filter(bad_type) == {:ok, :noop}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue