debug log well-known response body and text

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-01-13 18:08:50 -05:00 committed by June
parent 14a0d12002
commit ae11e378d2

View file

@ -550,12 +550,14 @@ async fn request_well_known(destination: &str) -> Option<String> {
.send() .send()
.await; .await;
debug!("Got well known response"); debug!("Got well known response");
debug!("Well known response: {:?}", response);
if let Err(e) = &response { if let Err(e) = &response {
debug!("Well known error: {e:?}"); debug!("Well known error: {e:?}");
return None; return None;
} }
let text = response.ok()?.text().await; let text = response.ok()?.text().await;
debug!("Got well known response text"); debug!("Got well known response text");
debug!("Well known response text: {:?}", text);
let body: serde_json::Value = serde_json::from_str(&text.ok()?).ok()?; let body: serde_json::Value = serde_json::from_str(&text.ok()?).ok()?;
Some(body.get("m.server")?.as_str()?.to_owned()) Some(body.get("m.server")?.as_str()?.to_owned())
} }