Merge branch 'hotfix/user_unfollow' into 'develop'
[akkoma] / lib / pleroma / web / activity_pub / publisher.ex
index 46edab0bd6c9e7144013b18c890d87adf34ef92e..262529b8412723f0f43d3bb9b9692ecee94d6aa5 100644 (file)
@@ -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,