Containment: Never fetch locally

This commit is contained in:
Lain Soykaf 2025-03-11 16:37:17 +04:00
commit 51c1d6fb2d
4 changed files with 25 additions and 0 deletions

View file

@ -166,6 +166,13 @@ defmodule Pleroma.Object.FetcherTest do
)
end
test "it does not fetch from local instance" do
local_url = Pleroma.Web.Endpoint.url() <> "/objects/local_resource"
assert {:fetch, {:error, "Trying to fetch local resource"}} =
Fetcher.fetch_object_from_id(local_url)
end
test "it validates content-type headers according to ActivityPub spec" do
# Setup a mock for an object with invalid content-type
mock(fn