Skip to content

Commit a2fbfd0

Browse files
committed
load whitelist by default as legacy
1 parent a89bc52 commit a2fbfd0

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use_http2: true,
2121
DEBUG: false,
2222

23+
WHITELIST_AUTO_LOAD: true, // Whitelist is always loaded by lib init. Otherwise use `initializeWhitelistLoader();`.
2324
WHITELIST_URL: 'https://iframely.com/qa/domains.json',
2425
WHITELIST_URL_RELOAD_PERIOD: 60 * 60 * 1000, // will reload WL every hour, if no local files are found in /whitelist folder
2526

@@ -440,4 +441,4 @@
440441
config.HTTP2_RETRY_CODES[item] = 1;
441442
});
442443

443-
export default config;
444+
export default config;

lib/whitelist.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,17 @@
392392
}
393393
}
394394

395-
export function initializeWhitelistLoader() {
395+
function privateInitializeWhitelistLoader() {
396396
startScanWhitelist();
397397
loadWhitelistUrl();
398398
}
399+
400+
export function initializeWhitelistLoader() {
401+
if (!CONFIG.WHITELIST_AUTO_LOAD) {
402+
privateInitializeWhitelistLoader();
403+
}
404+
}
405+
406+
if (CONFIG.WHITELIST_AUTO_LOAD) {
407+
privateInitializeWhitelistLoader();
408+
}

0 commit comments

Comments
 (0)