src/vs/workbench/contrib/url/browser/trustedDomainsValidator.ts/isURLDomainTrusted
export function isURLDomainTrusted(url: URI, trustedDomains: string[]) {
	url = URI.parse(normalizeURL(url));
	trustedDomains = trustedDomains.map(normalizeURL);

	if (isLocalhostAuthority(url.authority)) {
		return true;
	}

	for (let i = 0; i < trustedDomains.length; i++) {
		if (trustedDomains[i] === '*') {
			return true;
		}

		if (testUrlMatchesGlob(url.toString(), trustedDomains[i])) {
			return true;
		}
	}

	return false;
}