From ba21f655a46974476ebbe4ec6a9c2623ad9042e5 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sun, 17 Mar 2024 00:46:32 +0100 Subject: [PATCH] Replaced client in the block list error message with generic 403 Forbidden error message --- svr.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/svr.js b/svr.js index 35e8770..0852d26 100644 --- a/svr.js +++ b/svr.js @@ -4100,12 +4100,9 @@ if (!cluster.isPrimary) { try { // Scan the block list - if (blocklist.check(reqip) && href != "/favicon.ico") { - // Return client blocked message - var bheaders = getCustomHeaders(); - bheaders["Content-Type"] = "text/html; charset=utf8"; - res.writeHead(403, "Client blocked", bheaders); - res.write("Access denied - SVR.JS

ACCESS DENIED

Request from " + reqip + " is denied. The client is now in the block list.

SVR.JS/" + version + " (" + getOS() + "; " + (process.isBun ? ("Bun/v" + process.versions.bun + "; like Node.JS/" + process.version) : ("Node.JS/" + process.version)) + ")" + (req.headers.host == undefined ? "" : " on " + String(req.headers.host).replace(/&/g, "&").replace(//g, ">")) + "

"); + if (blocklist.check(reqip)) { + // Invoke 403 Forbidden error + callServerError(403); serverconsole.errmessage("Client blocked"); return; }