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:
@@ -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;
|
||||
};
|
||||
|
Reference in New Issue
Block a user