Switch from gen_magic to majic, use Majic.Plug, remove Pleroma.MIME

This commit is contained in:
href 2020-06-16 15:11:45 +02:00
commit f124f68205
20 changed files with 60 additions and 158 deletions

View file

@ -1428,9 +1428,9 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
desc = "Description of the image"
image = %Plug.Upload{
content_type: "image/jpg",
content_type: "bad/content-type",
path: Path.absname("test/fixtures/image.jpg"),
filename: "an_image.jpg"
filename: "an_image.png"
}
object =
@ -1445,6 +1445,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
assert [%{"href" => object_href, "mediaType" => object_mediatype}] = object["url"]
assert is_binary(object_href)
assert object_mediatype == "image/jpeg"
assert String.ends_with?(object_href, ".jpg")
activity_request = %{
"@context" => "https://www.w3.org/ns/activitystreams",

View file

@ -58,7 +58,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do
user = insert(:user)
file = %Plug.Upload{
content_type: "image/jpg",
content_type: "image/jpeg",
path: Path.absname("test/fixtures/image.jpg"),
filename: "an_image.jpg"
}