From 6edb3795788ea3cdaebf0a6c21acf6d7587d2244 Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 13 May 2024 02:15:40 +0200 Subject: [PATCH] fix: webfinger request should not request ld+json --- src/server/fetcher.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/fetcher.rs b/src/server/fetcher.rs index a1205b7e..76cb67bd 100644 --- a/src/server/fetcher.rs +++ b/src/server/fetcher.rs @@ -86,9 +86,11 @@ impl Fetcher for Context { async fn webfinger(&self, user: &str, host: &str) -> crate::Result { let subject = format!("acct:{user}@{host}"); let webfinger_uri = format!("https://{host}/.well-known/webfinger?resource={subject}"); - let resource = Self::request( - Method::GET, &webfinger_uri, None, &self.base(), &self.app().private_key, self.domain(), - ) + let resource = reqwest::Client::new() + .get(webfinger_uri) + .header(ACCEPT, "application/jrd+json") + .header(USER_AGENT, format!("upub+{VERSION} ({})", self.domain())) + .send() .await? .json::() .await?;