From 61ec592d668956aeb075585391414284016ecba9 Mon Sep 17 00:00:00 2001 From: Oneric Date: Tue, 26 Mar 2024 15:11:06 -0100 Subject: [PATCH] Drop obsolete pixelfed workaround This pixelfed issue was fixed in 2022-12 in https://github.com/pixelfed/pixelfed/pull/3932 Co-authored-by: FloatingGhost --- lib/pleroma/object/fetcher.ex | 4 ---- test/pleroma/object/fetcher_test.exs | 17 ----------------- 2 files changed, 21 deletions(-) diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex index 618fb278e..6609b8c1a 100644 --- a/lib/pleroma/object/fetcher.ex +++ b/lib/pleroma/object/fetcher.ex @@ -348,10 +348,6 @@ defmodule Pleroma.Object.Fetcher do {"ld+json", %{"profile" => "https://www.w3.org/ns/activitystreams"}} -> {:ok, final_id, body} - # pixelfed sometimes (and only sometimes) responds with http instead of https - {"ld+json", %{"profile" => "http://www.w3.org/ns/activitystreams"}} -> - {:ok, final_id, body} - _ -> {:error, {:content_type, content_type}} end diff --git a/test/pleroma/object/fetcher_test.exs b/test/pleroma/object/fetcher_test.exs index c59d77f0f..4c4831af3 100644 --- a/test/pleroma/object/fetcher_test.exs +++ b/test/pleroma/object/fetcher_test.exs @@ -773,23 +773,6 @@ defmodule Pleroma.Object.FetcherTest do end) assert {:ok, _, "{}"} = Fetcher.get_object("https://mastodon.social/2") - - Tesla.Mock.mock(fn - %{ - method: :get, - url: "https://mastodon.social/2" - } -> - %Tesla.Env{ - status: 200, - headers: [ - {"content-type", - "application/ld+json; profile=\"http://www.w3.org/ns/activitystreams\""} - ], - body: "{}" - } - end) - - assert {:ok, _, "{}"} = Fetcher.get_object("https://mastodon.social/2") end test "should not return ok with other content types" do