From cbbe4c9bc580d946989c062ee42523aeddf355f1 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sat, 2 Mar 2024 22:41:26 +0100 Subject: [PATCH] Fix errors with web root postfix adding functionality --- svr.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/svr.js b/svr.js index ba2e152..5261918 100644 --- a/svr.js +++ b/svr.js @@ -1176,6 +1176,7 @@ var disableTrailingSlashRedirects = false; var environmentVariables = {}; var wwwrootPostfixesVHost = []; var wwwrootPostfixPrefixesVHost = []; +var allowPostfixDoubleSlashes = false; // Get properties from config.json if (configJSON.blacklist != undefined) rawBlackList = configJSON.blacklist; @@ -1231,6 +1232,7 @@ if (configJSON.disableTrailingSlashRedirects != undefined) disableTrailingSlashR if (configJSON.environmentVariables != undefined) environmentVariables = configJSON.environmentVariables; if (configJSON.wwwrootPostfixesVHost != undefined) wwwrootPostfixesVHost = configJSON.wwwrootPostfixesVHost; if (configJSON.wwwrootPostfixPrefixesVHost != undefined) wwwrootPostfixPrefixesVHost = configJSON.wwwrootPostfixPrefixesVHost; +if (configJSON.allowPostfixDoubleSlashes != undefined) allowPostfixDoubleSlashes = configJSON.allowPostfixDoubleSlashes var wwwrootError = null; try { @@ -4369,7 +4371,7 @@ if (!cluster.isPrimary) { // Add web root postfixes if (!isProxy) { - var preparedReqUrl3 = (postFixEntry.allowDoubleSlashes ? (href.replace(/\/+/,"/") + (uobject.search ? uobject.search : "")) + (uobject.hash ? uobject.hash : "")) : req.url); + var preparedReqUrl3 = (allowPostfixDoubleSlashes ? (href.replace(/\/+/,"/") + (uobject.search ? uobject.search : "") + (uobject.hash ? uobject.hash : "")) : req.url); var urlWithPostfix = preparedReqUrl3; var postfixPrefix = ""; wwwrootPostfixPrefixesVHost.every(function (currentPostfixPrefix) {