activitypub: publisher: add (request-target) to http signature when POSTing
This commit is contained in:
parent
4a5b0965a0
commit
5bb418a90d
2 changed files with 5 additions and 1 deletions
|
|
@ -46,7 +46,9 @@ defmodule Pleroma.Web.ActivityPub.Publisher do
|
|||
"""
|
||||
def publish_one(%{inbox: inbox, json: json, actor: %User{} = actor, id: id} = params) do
|
||||
Logger.info("Federating #{id} to #{inbox}")
|
||||
host = URI.parse(inbox).host
|
||||
uri = URI.parse(inbox)
|
||||
host = uri.host
|
||||
path = uri.path
|
||||
|
||||
digest = "SHA-256=" <> (:crypto.hash(:sha256, json) |> Base.encode64())
|
||||
|
||||
|
|
@ -56,6 +58,7 @@ defmodule Pleroma.Web.ActivityPub.Publisher do
|
|||
|
||||
signature =
|
||||
Pleroma.Signature.sign(actor, %{
|
||||
"(request-target)": "post #{path}",
|
||||
host: host,
|
||||
"content-length": byte_size(json),
|
||||
digest: digest,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue