Fix relative URLs in manifests not being handled
This commit is contained in:
parent
ac481ec06a
commit
108eb427b8
1 changed files with 4 additions and 2 deletions
|
@ -20,12 +20,14 @@ struct ManifestIcon {
|
|||
|
||||
/// Scans a Web App Manifest for icons.
|
||||
pub async fn scan_manifest(client: &Client, url: impl IntoUrl) -> Result<Vec<Icon>, 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()
|
||||
|
|
Loading…
Add table
Reference in a new issue