From a2ecbe4c5a85bbba4a1c1c009bbce954777513f1 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Tue, 12 Sep 2023 23:19:14 +0200 Subject: [PATCH] Optimize mod loader --- svr.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svr.js b/svr.js index 29d76b3..40e5a59 100644 --- a/svr.js +++ b/svr.js @@ -2642,7 +2642,7 @@ if (!cluster.isPrimary) { }); var modFunction = ffinals; - proxyMods.slice().reverse().forEach(function (proxyMod) { + proxyMods.reverse().forEach(function (proxyMod) { modFunction = proxyMod.proxyCallback(req, socket, head, configJSON, serverconsole, modFunction); }); modFunction(); @@ -3245,7 +3245,7 @@ if (!cluster.isPrimary) { function modExecute(mods, ffinals) { // Prepare modFunction var modFunction = ffinals; - var useMods = mods; + var useMods = mods.slice(); if(isProxy) { // Get list of forward proxy mods @@ -3255,7 +3255,7 @@ if (!cluster.isPrimary) { }); } - useMods.slice().reverse().forEach(function (modO) { + useMods.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); });