summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOneric <oneric@oneric.stub>2024-03-26 15:44:44 -0100
committerLain Soykaf <lain@lain.com>2025-03-01 17:26:46 +0400
commit13a88bd1a5a13c771d33d327d54125c68bbb9cb3 (patch)
treebf374257e7df125b98801a3cf2b5f759d1e3c0ee /test
parent706bfffcda001236cd5df3012b745800d1b88756 (diff)
downloadpleroma-13a88bd1a5a13c771d33d327d54125c68bbb9cb3.tar.gz
pleroma-13a88bd1a5a13c771d33d327d54125c68bbb9cb3.zip
Register APNG MIME type
The newest git HEAD of MIME already knows about APNG, but this hasn’t been released yet. Without this, APNG attachments from remote posts won’t display as images in frontends. Fixes: akkoma#657
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs
index 6627fa6db..744ae8704 100644
--- a/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs
+++ b/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs
@@ -13,6 +13,23 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidatorTest do
import Pleroma.Factory
describe "attachments" do
+ test "works with apng" do
+ attachment =
+ %{
+ "mediaType" => "image/apng",
+ "name" => "",
+ "type" => "Document",
+ "url" =>
+ "https://media.misskeyusercontent.com/io/2859c26e-cd43-4550-848b-b6243bc3fe28.apng"
+ }
+
+ assert {:ok, attachment} =
+ AttachmentValidator.cast_and_validate(attachment)
+ |> Ecto.Changeset.apply_action(:insert)
+
+ assert attachment.mediaType == "image/apng"
+ end
+
test "fails without url" do
attachment = %{
"mediaType" => "",