From eafe1ed4900a5676ee000822842ffc33d856b753 Mon Sep 17 00:00:00 2001 From: Trinity Pointard Date: Fri, 28 Sep 2018 22:02:15 +0200 Subject: [PATCH] Add content digest to signed http headers Sign the Digest HTTP header --- plume-common/src/activity_pub/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plume-common/src/activity_pub/mod.rs b/plume-common/src/activity_pub/mod.rs index fbaf3c1..612964e 100644 --- a/plume-common/src/activity_pub/mod.rs +++ b/plume-common/src/activity_pub/mod.rs @@ -104,11 +104,12 @@ pub fn broadcast(send for inbox in boxes { // TODO: run it in Sidekiq or something like that + let mut headers = request::headers(); + headers.set(request::digest(signed.to_string())); let res = Client::new() .post(&inbox[..]) - .headers(request::headers()) - .header(request::signature(sender, request::headers())) - .header(request::digest(signed.to_string())) + .headers(headers.clone()) + .header(request::signature(sender, headers)) .body(signed.to_string()) .send(); match res {