transmogrifier: do not try to contain origin of something which doesn't have one

This commit is contained in:
William Pitcock 2018-10-25 04:27:33 +00:00
parent 4646794ee2
commit 5383887bd4

View File

@ -37,6 +37,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
@doc """ @doc """
Checks that an imported AP object's actor matches the domain it came from. Checks that an imported AP object's actor matches the domain it came from.
""" """
def contain_origin(id, %{"actor" => nil}), do: :error
def contain_origin(id, %{"actor" => actor} = params) do def contain_origin(id, %{"actor" => actor} = params) do
id_uri = URI.parse(id) id_uri = URI.parse(id)
actor_uri = URI.parse(get_actor(params)) actor_uri = URI.parse(get_actor(params))