From 108eb427b8d22e93026b365aa9433241ebc026fa Mon Sep 17 00:00:00 2001 From: CenTdemeern1 Date: Sun, 2 Feb 2025 23:06:24 +0100 Subject: [PATCH] Fix relative URLs in manifests not being handled --- src/manifest.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/manifest.rs b/src/manifest.rs index 197e422..c1b6bea 100644 --- a/src/manifest.rs +++ b/src/manifest.rs @@ -20,12 +20,14 @@ struct ManifestIcon { /// Scans a Web App Manifest for icons. pub async fn scan_manifest(client: &Client, url: impl IntoUrl) -> Result, Error> { - let manifest: Manifest = client.get(url).send().await?.json().await?; + let url = url.into_url()?; + let manifest: Manifest = client.get(url.clone()).send().await?.json().await?; Ok(join_all( manifest .icons .into_iter() - .map(|i| Icon::from_url(client, i.src, IconKind::LinkedInManifest)), + .filter_map(|i| url.join(&i.src).ok()) + .map(|u| Icon::from_url(client, u, IconKind::LinkedInManifest)), ) .await .into_iter()