aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-08-14 19:16:52 +0000
committerrinpatch <rinpatch@sdf.org>2019-08-14 19:16:52 +0000
commitdc902ad3df5acd6e64a871175552c3a37724e2ee (patch)
treeea23971b7f85b697bc8bd9567b4ce73d53832298 /lib
parent4be71c91e0862cbb0ffabdefb880d3af58a9f0d4 (diff)
parent1754f8ce6d9ee896a57961a354001b713c620cd5 (diff)
downloadpleroma-dc902ad3df5acd6e64a871175552c3a37724e2ee.tar.gz
Merge branch 'fix/http-signatures-post' into 'develop'
activitypub: publisher: add (request-target) to http signature when POSTing See merge request pleroma/pleroma!1569
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/publisher.ex3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/publisher.ex b/lib/pleroma/web/activity_pub/publisher.ex
index 46edab0bd..262529b84 100644
--- a/lib/pleroma/web/activity_pub/publisher.ex
+++ b/lib/pleroma/web/activity_pub/publisher.ex
@@ -46,7 +46,7 @@ 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
+ %{host: host, path: path} = URI.parse(inbox)
digest = "SHA-256=" <> (:crypto.hash(:sha256, json) |> Base.encode64())
@@ -56,6 +56,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,