From 46b9a339f708fd0831f219692d44e544df62db7a Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 26 Mar 2024 21:02:07 +0100 Subject: [PATCH] fix: also full AP header --- src/dispatcher.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dispatcher.rs b/src/dispatcher.rs index 2b83b34d..3d51d0e7 100644 --- a/src/dispatcher.rs +++ b/src/dispatcher.rs @@ -101,7 +101,7 @@ async fn deliver(key: &PKey, to: &str, from: &str, payload: serde_json: let payload = serde_json::to_string(&payload).unwrap(); let digest = format!("sha-256={}", sha256::digest(&payload)); let host = Context::server(to); - let date = chrono::Utc::now().format("%d %b $Y %H:%M:%S %Z").to_string(); // TODO literally what the fuck + let date = chrono::Utc::now().format("%d %b %Y %H:%M:%S %Z").to_string(); // TODO literally what the fuck let headers : BTreeMap = [ ("Host".to_string(), host.clone()), @@ -124,13 +124,15 @@ async fn deliver(key: &PKey, to: &str, from: &str, payload: serde_json: .unwrap() .signature_header(); + tracing::info!("signature header: {signature_header}"); + let res = reqwest::Client::new() .post(to) .header("Host", host) .header("Date", date) .header("Digest", digest) .header("Signature", signature_header) - .header(CONTENT_TYPE, "application/ld+json") + .header(CONTENT_TYPE, "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") .header(USER_AGENT, format!("upub+{VERSION} ({domain})")) // TODO put instance admin email .body(payload) .send()