From 862dcb15bb3b6b20a026f7645b50847f41617a8d Mon Sep 17 00:00:00 2001 From: mrrfv Date: Wed, 27 Sep 2023 14:10:12 +0000 Subject: [PATCH] Remove empty lines from the user-defined list URLs Possible fix for #33 --- lib/constants.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/constants.js b/lib/constants.js index 1cf874a..9567b91 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -33,11 +33,12 @@ export const LIST_TYPE = { }; export const USER_DEFINED_ALLOWLIST_URLS = process.env.ALLOWLIST_URLS - ? process.env.ALLOWLIST_URLS.split("\n") + // .filter(x => x) removes empty items from the URL arrays + ? process.env.ALLOWLIST_URLS.split("\n").filter(x => x) : undefined; export const USER_DEFINED_BLOCKLIST_URLS = process.env.BLOCKLIST_URLS - ? process.env.BLOCKLIST_URLS.split("\n") + ? process.env.BLOCKLIST_URLS.split("\n").filter(x => x) : undefined; export const RECOMMENDED_ALLOWLIST_URLS = [