Commit 71f48456 authored by Colin Reeder's avatar Colin Reeder

Fix signature host value to use hostname and port

parent 9009ba0f
Pipeline #27679 passed with stages
in 15 minutes and 48 seconds
......@@ -49,7 +49,7 @@ defmodule Pleroma.Web.ActivityPub.Publisher do
def publish_one(%{inbox: inbox, json: json, actor: %User{} = actor, id: id} = params) do
Logger.debug("Federating #{id} to #{inbox}")
%{authority: authority, path: path} = URI.parse(inbox)
%{host: host, port: port, path: path, scheme: scheme} = URI.parse(inbox)
digest = "SHA-256=" <> (:crypto.hash(:sha256, json) |> Base.encode64())
......@@ -58,7 +58,12 @@ defmodule Pleroma.Web.ActivityPub.Publisher do
signature =
Pleroma.Signature.sign(actor, %{
"(request-target)": "post #{path}",
host: authority,
if port == URI.default_port(scheme) do
"content-length": byte_size(json),
digest: digest,
date: date
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment