mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-26 14:21:19 +00:00
parent
155af88582
commit
80571567e1
3 changed files with 25 additions and 0 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -2624,6 +2624,7 @@ dependencies = [
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"regex",
|
"regex",
|
||||||
|
"reqwest",
|
||||||
"reqwest-middleware",
|
"reqwest-middleware",
|
||||||
"rosetta-build",
|
"rosetta-build",
|
||||||
"rosetta-i18n",
|
"rosetta-i18n",
|
||||||
|
|
|
@ -47,5 +47,9 @@ jsonwebtoken = "8.1.1"
|
||||||
lettre = "0.10.1"
|
lettre = "0.10.1"
|
||||||
comrak = { version = "0.14.0", default-features = false }
|
comrak = { version = "0.14.0", default-features = false }
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
reqwest = { workspace = true }
|
||||||
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
rosetta-build = "0.1.2"
|
rosetta-build = "0.1.2"
|
||||||
|
|
|
@ -37,6 +37,7 @@ pub struct WebfingerLink {
|
||||||
#[serde(rename = "type")]
|
#[serde(rename = "type")]
|
||||||
pub kind: Option<String>,
|
pub kind: Option<String>,
|
||||||
pub href: Option<Url>,
|
pub href: Option<Url>,
|
||||||
|
#[serde(default)]
|
||||||
pub properties: HashMap<String, String>,
|
pub properties: HashMap<String, String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,3 +58,22 @@ macro_rules! location_info {
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use reqwest::Client;
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
#[ignore]
|
||||||
|
async fn test_webfinger() {
|
||||||
|
let client = Client::default();
|
||||||
|
let fetch_url =
|
||||||
|
"https://kino.schuerz.at/.well-known/webfinger?resource=acct:h0e@kino.schuerz.at";
|
||||||
|
|
||||||
|
let response = client.get(fetch_url).send().await.unwrap();
|
||||||
|
|
||||||
|
let res = response.json::<WebfingerResponse>().await;
|
||||||
|
assert!(res.is_ok());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue