Merge pull request #3072 from mxbeer/bugfix/favicon-www-hostname

respect www subdomain when fetching website favicon
This commit is contained in:
Mike Cao 2024-11-26 19:48:49 -08:00 committed by GitHub
commit bf89dfdd49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,5 @@
function getHostName(url: string) {
const match = url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:/\n?=]+)/im);
const match = url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?([^:/\n?=]+)/im);
return match && match.length > 1 ? match[1] : null;
}