1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-06-05 21:49:31 +02:00

Extend the Google Service check and also include subdomains (#1560)

This commit is contained in:
nobody
2023-12-27 07:15:58 +01:00
parent adf2f920b5
commit 20c14f7314
2 changed files with 10 additions and 3 deletions

View File

@@ -296,5 +296,12 @@ helpers.compareVersion = function (v1, v2) {
};
helpers.isGoogleDomain = function (initiatorDomain) {
return GoogleDomains[initiatorDomain.replace('www.', '')] || false;
let parts = initiatorDomain.split('.');
// remove subdomains if exist
if (parts.length > 2) {
parts.shift();
}
return GoogleDomains[parts.join('.')] || false;
};