1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2024-12-23 08:30:38 +01:00

Exclude domains for logging (#167)

This commit is contained in:
nobody 2020-11-09 06:18:14 +01:00
parent b0bb2add31
commit 0a167a791e
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
2 changed files with 6 additions and 5 deletions

View File

@ -268,6 +268,11 @@ const CDNs = {
'www.gstatic.com': 'gstatic.com',
};
const IgnoredHost = {
'fonts.googleapis.com': true,
'www.gstatic.com': true
};
// Supported charsets for TextDecoder()
// https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/TextDecoder
const EncodingTypes = {

View File

@ -176,11 +176,7 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
}
}
if (
requestAnalyzer.logging &&
channelHost + channelPath !== 'fonts.googleapis.com/css' &&
channelHost + channelPath !== 'fonts.googleapis.com/css2'
) {
if (requestAnalyzer.logging && !IgnoredHost[channelHost]) {
console.warn('[ LocalCDN ] Missing resource: ' + channelHost + channelPath);
}
return false;