From dc416bf2551b2da3fc3dc2ad03f2710479d5a9f1 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sat, 13 Nov 2021 00:03:44 +0100 Subject: [PATCH] Make http signature compatible with mastodon --- crates/apub_lib/src/signatures.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/apub_lib/src/signatures.rs b/crates/apub_lib/src/signatures.rs index 3329b681..1e45a3e6 100644 --- a/crates/apub_lib/src/signatures.rs +++ b/crates/apub_lib/src/signatures.rs @@ -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()) -- 2.44.1