aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index b33912721..52f5a0c70 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -774,11 +774,16 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
digest = "SHA-256=" <> (:crypto.hash(:sha256, json) |> Base.encode64())
+ date =
+ NaiveDateTime.utc_now()
+ |> Timex.format!("{WDshort}, {D} {Mshort} {YYYY} {h24}:{m}:{s} GMT")
+
signature =
Pleroma.Web.HTTPSignatures.sign(actor, %{
host: host,
"content-length": byte_size(json),
- digest: digest
+ digest: digest,
+ date: date
})
with {:ok, %{status: code}} when code in 200..299 <-
@@ -788,6 +793,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
json,
[
{"Content-Type", "application/activity+json"},
+ {"Date", date},
{"signature", signature},
{"digest", digest}
]