Skip to content

Commit 769739f

Browse files
ingriakastov
authored andcommitted
fix: favicon resolver
fixes remnawave/panel#219
1 parent a5265f8 commit 769739f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/shared/utils/misc/favicon-resolver.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { parseURL } from 'ufo'
22

33
export const faviconResolver = (faviconLink: null | string) => {
44
if (!faviconLink) return null
5-
const hostLink = parseURL(faviconLink).host
6-
if (hostLink) {
7-
// return `https://icons.duckduckgo.com/ip2/${hostLink}.ico`
8-
return `https://www.google.com/s2/favicons?sz=64&domain=${hostLink}`
5+
const { host, protocol } = parseURL(faviconLink, 'https://')
6+
if (host) {
7+
// return `https://icons.duckduckgo.com/ip2/${host}.ico`
8+
return `https://www.google.com/s2/favicons?sz=64&domain_url=${protocol}//${host}`
99
}
1010
return null
1111
}

0 commit comments

Comments
 (0)