From d207281a532cc9b601128a10cce61cd6bd0860fc Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sat, 23 Aug 2025 09:03:08 +0100 Subject: [PATCH] Set forbidden status code on domain block Signed-off-by: Marcus Noble --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 993bc12..07146c5 100644 --- a/index.js +++ b/index.js @@ -26,10 +26,12 @@ http.createServer((req, response) => { if(blockList.some(b => remoteURL.hostname == b || remoteURL.hostname.endsWith("." + b))) { console.log("Domain 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") + response.writeHead(403); return response.end(); }