forked from alemi/upub
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> {
|
||||
reqwest::get(format!("https://{domain}/nodeinfo/2.0.json"))
|
||||
.await?
|
||||
.json()
|
||||
.await
|
||||
match reqwest::get(format!("https://{domain}/nodeinfo/2.0.json")).await {
|
||||
Ok(res) => res.json().await,
|
||||
// ughhh pleroma wants with json, key without
|
||||
Err(_) => reqwest::get(format!("https://{domain}/nodeinfo/2.0.json"))
|
||||
.await?
|
||||
.json()
|
||||
.await,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue