aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-09-04 17:56:05 -0500
committerrinpatch <rinpatch@sdf.org>2020-09-08 12:29:38 +0300
commit216c84a8f4d82649110ffaa2bc9d02b879805c5f (patch)
tree8cc0eee8377ad60bd405f8544a0acea1b8116154 /test
parent3a98960c2684229435c5d04e4f3e0611098ceea2 (diff)
downloadpleroma-216c84a8f4d82649110ffaa2bc9d02b879805c5f.tar.gz
Bypass the filter based on content-type as well in case a webp image is uploaded with the wrong file extension.
Diffstat (limited to 'test')
-rw-r--r--test/upload/filter/exiftool_test.exs10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/upload/filter/exiftool_test.exs b/test/upload/filter/exiftool_test.exs
index fe24036d9..84a3f8b30 100644
--- a/test/upload/filter/exiftool_test.exs
+++ b/test/upload/filter/exiftool_test.exs
@@ -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