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
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
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;
};

View File

@ -25,9 +25,9 @@
<h2>New in LocalCDN:</h2>
</div>
<div class="release-notes-area">
<p></p>
<p>Improved</p>
<ul>
<li></li>
<li>Extend the Google Service check and also include subdomains (<a href="https://codeberg.org/nobody/LocalCDN/issues/1560">#1560</a>)</li>
</ul>
</div>
<div id="generator-section">