fix: try both 2.0.json and 2.0 for nodeinfo
This commit is contained in:
parent
cf26b77fdf
commit
3d504e5059
1 changed files with 8 additions and 4 deletions
|
@ -57,9 +57,13 @@ impl Entity {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn nodeinfo(domain: &str) -> reqwest::Result<NodeInfoOwned> {
|
pub async fn nodeinfo(domain: &str) -> reqwest::Result<NodeInfoOwned> {
|
||||||
reqwest::get(format!("https://{domain}/nodeinfo/2.0.json"))
|
match reqwest::get(format!("https://{domain}/nodeinfo/2.0.json")).await {
|
||||||
.await?
|
Ok(res) => res.json().await,
|
||||||
.json()
|
// ughhh pleroma wants with json, key without
|
||||||
.await
|
Err(_) => reqwest::get(format!("https://{domain}/nodeinfo/2.0.json"))
|
||||||
|
.await?
|
||||||
|
.json()
|
||||||
|
.await,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue