From 84b7cac684307c1f74a9c6af70c84076dc615e2c Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Tue, 12 Sep 2023 23:15:55 +0200 Subject: [PATCH] Fix bug with mods executing in wrong order (bug was related with access control vulnerability fix; bug was not present in LTS versions) --- svr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svr.js b/svr.js index 5f51a02..29d76b3 100644 --- a/svr.js +++ b/svr.js @@ -2642,7 +2642,7 @@ if (!cluster.isPrimary) { }); var modFunction = ffinals; - proxyMods.reverse().forEach(function (proxyMod) { + proxyMods.slice().reverse().forEach(function (proxyMod) { modFunction = proxyMod.proxyCallback(req, socket, head, configJSON, serverconsole, modFunction); }); modFunction(); @@ -3255,7 +3255,7 @@ if (!cluster.isPrimary) { }); } - useMods.reverse().forEach(function (modO) { + useMods.slice().reverse().forEach(function (modO) { modFunction = modO.callback(req, res, serverconsole, responseEnd, href, ext, uobject, search, "index.html", users, page404, head, foot, "", modFunction, configJSON, callServerError, getCustomHeaders, origHref, redirect, parsePostData); });