From b0f47de2780c188be10991b9f9a6230270c119dd Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 31 May 2024 15:23:18 +0200 Subject: [PATCH] fix: sharkey wants trailing slash too --- upub/core/src/server/fetcher.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/upub/core/src/server/fetcher.rs b/upub/core/src/server/fetcher.rs index 1460aa5..0bf41f9 100644 --- a/upub/core/src/server/fetcher.rs +++ b/upub/core/src/server/fetcher.rs @@ -131,7 +131,7 @@ impl Fetcher for Context { let document = Self::request( Method::GET, id, None, - &format!("https://{}", self.domain()), self.pkey(), self.domain(), + &format!("https://{}/", self.domain()), self.pkey(), self.domain(), ) .await? .json::() @@ -207,7 +207,8 @@ impl Fetcher for Context { }; if let Ok(res) = Self::request( - Method::GET, &format!("https://{domain}"), None, &format!("https://{}", self.domain()), self.pkey(), self.domain(), + Method::GET, &format!("https://{domain}"), None, + &format!("https://{}/", self.domain()), self.pkey(), self.domain(), ).await { if let Ok(actor) = res.json::().await { if let Some(name) = actor.name() { @@ -243,7 +244,7 @@ impl Fetcher for Context { if let Some(followers_url) = &document.followers().id() { let req = Self::request( Method::GET, followers_url, None, - &format!("https://{}", self.domain()), self.pkey(), self.domain(), + &format!("https://{}/", self.domain()), self.pkey(), self.domain(), ).await; if let Ok(res) = req { if let Ok(user_followers) = res.json::().await { @@ -255,9 +256,9 @@ impl Fetcher for Context { } if let Some(following_url) = &document.following().id() { - let req = Self::request( + let req = Self::request( Method::GET, following_url, None, - &format!("https://{}", self.domain()), self.pkey(), self.domain(), + &format!("https://{}/", self.domain()), self.pkey(), self.domain(), ).await; if let Ok(res) = req { if let Ok(user_following) = res.json::().await {