Fix checking web service allowed hosts

This commit is contained in:
Samuel Elliott 2023-08-21 06:18:16 +01:00
parent c5d8d25334
commit 2680b03c46
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6

View File

@ -145,11 +145,12 @@ function isWebServiceUrlAllowed(webservice: WebService, url: string | URL) {
for (const host of webservice.whiteList) {
if (host.startsWith('*.')) {
return url.hostname === host.substr(2) ||
url.hostname.endsWith(host.substr(1));
if (url.hostname === host.substr(2) ||
url.hostname.endsWith(host.substr(1))
) return true;
}
return url.hostname === host;
if (url.hostname === host) return true;
}
return false;