mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-04-24 06:56:54 -05:00
Fix checking web service allowed hosts
This commit is contained in:
parent
c5d8d25334
commit
2680b03c46
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user