activitypub: fix date header format
authorWilliam Pitcock <nenolod@dereferenced.org>
Fri, 1 Mar 2019 12:21:09 +0000 (12:21 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Fri, 1 Mar 2019 12:22:45 +0000 (12:22 +0000)
HTTP date header specification says that days must always be two-digit.
Accordingly, change the format string used to ensure days are always
represented as two-digit (e.g. 01).

lib/pleroma/web/activity_pub/activity_pub.ex

index 52404c7e5804eaa30564085a7fc2633f4660bc9e..16ae6586753a4dfb26d6a49d340e59362defbfa1 100644 (file)
@@ -828,7 +828,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
 
     date =
       NaiveDateTime.utc_now()
-      |> Timex.format!("{WDshort}, {D} {Mshort} {YYYY} {h24}:{m}:{s} GMT")
+      |> Timex.format!("{WDshort}, {0D} {Mshort} {YYYY} {h24}:{m}:{s} GMT")
 
     signature =
       Pleroma.Web.HTTPSignatures.sign(actor, %{