Skip to content

Commit

Permalink
fix relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
seadfeng committed Sep 5, 2024
1 parent a0f27cf commit 50e1ee3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const getFavicons = async ({ url, headers }: { url: string, headers?: Hea
if (href) {
icons.push({
sizes: sizes || 'unknown',
href: (href.startsWith('http') || href.startsWith('data:image')) ? href : `${responseUrl.protocol}//${responseUrl.host}${href}`
href: (href.startsWith('http') || href.startsWith('data:image')) ? href : `${responseUrl.protocol}//${responseUrl.host}${/^\/.*/.test(href) ? href : `/${href}`}`
});
}
});
Expand Down

0 comments on commit 50e1ee3

Please # to comment.