]> Untitled Git - lemmy.git/commitdiff
Make http signature compatible with mastodon
authorFelix Ableitner <me@nutomic.com>
Fri, 12 Nov 2021 23:03:44 +0000 (00:03 +0100)
committerFelix Ableitner <me@nutomic.com>
Tue, 16 Nov 2021 17:06:01 +0000 (18:06 +0100)
crates/apub_lib/src/signatures.rs

index 3329b6819e8c2e21c8f83e43f01a757a640b548a..1e45a3e629eba4a7b4ef341a40e0a959a3612817 100644 (file)
@@ -44,10 +44,9 @@ pub async fn sign_and_send(
     HeaderValue::from_str(APUB_JSON_CONTENT_TYPE)?,
   );
   headers.insert(HeaderName::from_str("Host")?, HeaderValue::from_str(&host)?);
-  headers.insert(
-    HeaderName::from_str("Date")?,
-    HeaderValue::from_str(&Utc::now().to_rfc2822())?,
-  );
+  // Need to use legacy timezone because mastodon and doesnt understand any new standards
+  let date = Utc::now().to_rfc2822().replace("+0000", "GMT");
+  headers.insert(HeaderName::from_str("Date")?, HeaderValue::from_str(&date)?);
 
   let response = client
     .post(&inbox_url.to_string())