From fdacb09bdecb246d9bfdfda5ba709f1b5a8cef79 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sat, 23 Aug 2025 09:14:57 +0100 Subject: [PATCH] Update logging Signed-off-by: Marcus Noble --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 07146c5..4781da5 100644 --- a/index.js +++ b/index.js @@ -25,12 +25,12 @@ http.createServer((req, response) => { if(!remoteURL.hostname || remoteURL.hostname === 'localhost') return response.end(); if(blockList.some(b => remoteURL.hostname == b || remoteURL.hostname.endsWith("." + b))) { - console.log("Domain is in blocklist") + console.log(`Domain '${remoteURL.hostname}' is in blocklist`) response.writeHead(403); return response.end(); } if(allowList.length > 0 && !allowList.some(b => remoteURL.hostname == b || remoteURL.hostname.endsWith("." + b))) { - console.log("Domain is not in allowlist") + console.log(`Domain '${remoteURL.hostname}' is not in allowlist`) response.writeHead(403); return response.end(); } @@ -87,8 +87,8 @@ function loadWebpage(req, res) { res.writeHead(200); res.end( contents - .replaceAll('[[BLOCKLIST]]', JSON.stringify(blockList)) - .replaceAll('[[ALLOWLIST]]', JSON.stringify(allowList)) + .replaceAll('[[BLOCKLIST]]', JSON.stringify(blockList)) + .replaceAll('[[ALLOWLIST]]', JSON.stringify(allowList)) ); }) .catch(err => {