Set forbidden status code on domain block

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
2025-08-23 09:03:08 +01:00
parent 352ae3a840
commit d207281a53

View File

@@ -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();
}