logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: bb2f4a76b3af4ad5f0e2950ef8dc2567c6ad69ff
parent 3dadb9ed086fb63a3e664a43be3bf30f9ffbfb2d
Author: Mark Felder <feld@feld.me>
Date:   Wed, 28 Aug 2024 17:01:30 -0400

Add test for origin containment failures

Diffstat:

Mtest/pleroma/workers/receiver_worker_test.exs17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/test/pleroma/workers/receiver_worker_test.exs b/test/pleroma/workers/receiver_worker_test.exs @@ -177,4 +177,21 @@ defmodule Pleroma.Workers.ReceiverWorkerTest do assert {:ok, %Pleroma.Activity{}} = ReceiverWorker.perform(oban_job) end + + test "cancels due to origin containment" do + params = + insert(:note_activity).data + |> Map.put("id", "https://notorigindomain.com/activity") + + {:ok, oban_job} = + Federator.incoming_ap_doc(%{ + method: "POST", + req_headers: [], + request_path: "/inbox", + params: params, + query_string: "" + }) + + assert {:cancel, :origin_containment_failed} = ReceiverWorker.perform(oban_job) + end end