From 7e73cb68d308fb764c417eca590f3539a70e234e Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sat, 13 Jan 2024 07:53:16 +0100 Subject: [PATCH] Added support for skipping URL rewriting, when the URL refers to a file or a directory. --- svr.js | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/svr.js b/svr.js index b8f3119..1360963 100644 --- a/svr.js +++ b/svr.js @@ -4177,24 +4177,41 @@ if (!cluster.isPrimary) { } // Handle URL rewriting - function rewriteURL(address, map, callback) { + function rewriteURL(address, map, callback, _fileState, _mapBegIndex) { var rewrittenURL = address; if (!isProxy) { - map.every(function (mapEntry) { - if (matchHostname(mapEntry.host) && createRegex(mapEntry.definingRegex).test(address)) { + var doCallback = true; + for(var i=(_mapBegIndex ? _mapBegIndex : 0);i