mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-01-05 06:48:41 +00:00
Cancel if the User fetch resulted in a 410
This commit is contained in:
parent
60101e240d
commit
66e1b40895
1 changed files with 23 additions and 0 deletions
|
@ -65,6 +65,12 @@ defmodule Pleroma.Workers.ReceiverWorkerTest do
|
||||||
status: 404,
|
status: 404,
|
||||||
body: ""
|
body: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%{url: "https://springfield.social/users/hankscorpio"} ->
|
||||||
|
%Tesla.Env{
|
||||||
|
status: 410,
|
||||||
|
body: ""
|
||||||
|
}
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -101,6 +107,23 @@ defmodule Pleroma.Workers.ReceiverWorkerTest do
|
||||||
|
|
||||||
assert {:cancel, {:error, :not_found}} = ReceiverWorker.perform(oban_job)
|
assert {:cancel, {:error, :not_found}} = ReceiverWorker.perform(oban_job)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "when request returns a 410" do
|
||||||
|
params =
|
||||||
|
insert(:note_activity).data
|
||||||
|
|> Map.put("actor", "https://springfield.social/users/hankscorpio")
|
||||||
|
|
||||||
|
{:ok, oban_job} =
|
||||||
|
Federator.incoming_ap_doc(%{
|
||||||
|
method: "POST",
|
||||||
|
req_headers: [],
|
||||||
|
request_path: "/inbox",
|
||||||
|
params: params,
|
||||||
|
query_string: ""
|
||||||
|
})
|
||||||
|
|
||||||
|
assert {:cancel, {:error, :not_found}} = ReceiverWorker.perform(oban_job)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it can validate the signature" do
|
test "it can validate the signature" do
|
||||||
|
|
Loading…
Reference in a new issue