Don't sign fetch when fetching actor for a given signature
Otherwise it's doing a loop Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -650,9 +650,10 @@ defmodule Mobilizon.Federation.ActivityPub.Utils do
|
||||
@doc """
|
||||
Sign a request with an actor.
|
||||
"""
|
||||
@spec sign_fetch(Enum.t(), Actor.t(), String.t(), String.t()) :: Enum.t()
|
||||
def sign_fetch(headers, actor, id, date) do
|
||||
if Mobilizon.Config.get([:activitypub, :sign_object_fetches]) do
|
||||
@spec sign_fetch(Enum.t(), Actor.t(), String.t(), String.t(), Keyword.t()) :: Enum.t()
|
||||
def sign_fetch(headers, actor, id, date, options \\ []) do
|
||||
if Mobilizon.Config.get([:activitypub, :sign_object_fetches]) and
|
||||
Keyword.get(options, :ignore_sign_object_fetches, false) == false do
|
||||
headers ++ make_signature(actor, id, date)
|
||||
else
|
||||
headers
|
||||
|
||||
Reference in New Issue
Block a user