From 2f232614a29fec551f00f64ca23c43c36d9b2ba8 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sat, 2 Mar 2024 22:02:24 +0100 Subject: [PATCH] Fix URL rewriting on URLs with double slashes --- svr.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/svr.js b/svr.js index 0e9f18a..ff2a8a2 100644 --- a/svr.js +++ b/svr.js @@ -4315,7 +4315,10 @@ if (!cluster.isPrimary) { doCallback = false; break; } - if (!mapEntry.allowDoubleSlashes) address = address.replace(/\/+/g,"/"); + if (!mapEntry.allowDoubleSlashes) { + address = address.replace(/\/+/g,"/"); + rewrittenURL = address; + } if (matchHostname(mapEntry.host) && ipMatch(mapEntry.ip, req.socket ? req.socket.localAddress : undefined) && address.match(createRegex(mapEntry.definingRegex)) && !(mapEntry.isNotDirectory && _fileState == 2) && !(mapEntry.isNotFile && _fileState == 1)) { try { mapEntry.replacements.forEach(function (replacement) {