From 81b6a7183af19b45607a3c122f9c629a035d1151 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 26 Mar 2024 03:05:43 +0100 Subject: [PATCH] fix: log delivery responses bodies --- src/dispatcher.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dispatcher.rs b/src/dispatcher.rs index ac817f4b..3b16cbdd 100644 --- a/src/dispatcher.rs +++ b/src/dispatcher.rs @@ -104,7 +104,7 @@ impl Dispatcher { } async fn deliver(target: &str, payload: &serde_json::Value, host: String, date: String, signature_header: String, domain: &str) -> Result<(), reqwest::Error> { - reqwest::Client::new() + let res = reqwest::Client::new() .post(target) .json(payload) .header("Host", host) @@ -113,7 +113,10 @@ async fn deliver(target: &str, payload: &serde_json::Value, host: String, date: .header(USER_AGENT, format!("upub+{VERSION} ({domain})")) // TODO put instance admin email .send() .await? - .error_for_status()?; + .error_for_status()? + .text() + .await?; + tracing::info!("server answered with OK '{res}'"); Ok(()) }