aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2019-08-14 19:00:48 +0000
committerAriadne Conill <ariadne@dereferenced.org>2019-08-14 19:01:51 +0000
commit5bb418a90d9efb1fa889028080c5de3a929ff2cc (patch)
tree461ea0f5392b41c625c1f1fdda6f197f2c07e458 /lib
parent4a5b0965a0d07d45bfc4687c80c752ec824457cc (diff)
downloadpleroma-5bb418a90d9efb1fa889028080c5de3a929ff2cc.tar.gz
activitypub: publisher: add (request-target) to http signature when POSTing
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/publisher.ex5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/publisher.ex b/lib/pleroma/web/activity_pub/publisher.ex
index 46edab0bd..987a25377 100644
--- a/lib/pleroma/web/activity_pub/publisher.ex
+++ b/lib/pleroma/web/activity_pub/publisher.ex
@@ -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,