summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLain Soykaf <lain@lain.com>2025-03-11 16:37:17 +0400
committerLain Soykaf <lain@lain.com>2025-03-11 16:37:17 +0400
commit51c1d6fb2dd91a1a1ac11fed0f0a4211719e30b8 (patch)
tree62085fdc9d51e63392a497179b1f4c89241e31dd /test
parentb0c2ec5fb9ca1908dddbc66260861d4743b991b7 (diff)
downloadpleroma-51c1d6fb2dd91a1a1ac11fed0f0a4211719e30b8.tar.gz
pleroma-51c1d6fb2dd91a1a1ac11fed0f0a4211719e30b8.zip
Containment: Never fetch locally
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/object/fetcher_test.exs7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/pleroma/object/fetcher_test.exs b/test/pleroma/object/fetcher_test.exs
index 32689a68d..7ba5090e1 100644
--- a/test/pleroma/object/fetcher_test.exs
+++ b/test/pleroma/object/fetcher_test.exs
@@ -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