This commit is contained in:
Felix Ableitner 2025-01-21 12:52:47 +01:00
parent a53d874a12
commit 4991c1f9d9
2 changed files with 3 additions and 5 deletions

View file

@ -132,8 +132,9 @@ async fn fetch_object_http_with_accept<T: Clone, Kind: DeserializeOwned>(
req.send().await?
};
if let Some(location) = res.headers().get(LOCATION) {
let location: Url = location.to_str().unwrap().parse()?;
let location = res.headers().get(LOCATION).and_then(|l| l.to_str().ok());
if let Some(location) = location {
let location = location.parse()?;
return Box::pin(fetch_object_http_with_accept(&location, data, content_type)).await;
}

View file

@ -26,9 +26,6 @@ pub enum WebFingerError {
/// The wefinger object did not contain any link to an activitypub item
#[error("The webfinger object did not contain any link to an activitypub item")]
NoValidLink,
/// Webfinger request was redirected which is not allowed
#[error("Webfinger request was redirected which is not allowed")]
RedirectNotAllowed,
}
impl WebFingerError {