forked from alemi/upub
fix: log delivery responses bodies
This commit is contained in:
parent
83b0b35043
commit
81b6a7183a
1 changed files with 5 additions and 2 deletions
|
@ -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> {
|
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)
|
.post(target)
|
||||||
.json(payload)
|
.json(payload)
|
||||||
.header("Host", host)
|
.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
|
.header(USER_AGENT, format!("upub+{VERSION} ({domain})")) // TODO put instance admin email
|
||||||
.send()
|
.send()
|
||||||
.await?
|
.await?
|
||||||
.error_for_status()?;
|
.error_for_status()?
|
||||||
|
.text()
|
||||||
|
.await?;
|
||||||
|
tracing::info!("server answered with OK '{res}'");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue