From 7be1c2a73b4d2dfe1e2add199e061a96df52e8a1 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sat, 16 Dec 2023 08:59:49 +0100 Subject: [PATCH] Fixed host name rewriting --- svr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svr.js b/svr.js index 61eeea1..5e6a3ba 100644 --- a/svr.js +++ b/svr.js @@ -2968,7 +2968,7 @@ if (!cluster.isPrimary) { var oldHostHeader = req.headers.host; if (typeof req.headers.host == "string") { req.headers.host = req.headers.host.toLowerCase(); - if(!req.headers.host.match(/^\.+$/)) req.headers.host = req.headers.host.replace(/^\.$/g,""); + if(!req.headers.host.match(/^\.+$/)) req.headers.host = req.headers.host.replace(/\.$/g,""); } if (!isProxy) serverconsole.reqmessage("Client " + ((!reqip || reqip == "") ? "[unknown client]" : (reqip + ((reqport && reqport !== 0) && reqport != "" ? ":" + reqport : ""))) + " wants " + (req.method == "GET" ? "content in " : (req.method == "POST" ? "to post content in " : (req.method == "PUT" ? "to add content in " : (req.method == "DELETE" ? "to delete content in " : (req.method == "PATCH" ? "to patch content in " : "to access content using " + req.method + " method in "))))) + (req.headers.host == undefined ? "" : req.headers.host) + req.url);