mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-11-14 04:52:17 +00:00
Object.Fetcher: Hook to MRF.id_filter
This commit is contained in:
parent
03e14e759d
commit
3dd6f65859
1 changed files with 4 additions and 0 deletions
|
@ -145,6 +145,7 @@ defmodule Pleroma.Object.Fetcher do
|
|||
Logger.debug("Fetching object #{id} via AP")
|
||||
|
||||
with {:scheme, true} <- {:scheme, String.starts_with?(id, "http")},
|
||||
{_, true} <- {:mrf, MRF.id_filter(id)},
|
||||
{:ok, body} <- get_object(id),
|
||||
{:ok, data} <- safe_json_decode(body),
|
||||
:ok <- Containment.contain_origin_from_id(id, data) do
|
||||
|
@ -160,6 +161,9 @@ defmodule Pleroma.Object.Fetcher do
|
|||
{:error, e} ->
|
||||
{:error, e}
|
||||
|
||||
{:mrf, false} ->
|
||||
{:error, {:reject, "Filtered by id"}}
|
||||
|
||||
e ->
|
||||
{:error, e}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue