1
0
Fork 0
forked from svrjs/svrjs

Optimize mod loader

This commit is contained in:
Dorian Niemiec 2023-09-12 23:19:14 +02:00
parent 84b7cac684
commit a2ecbe4c5a

6
svr.js
View file

@ -2642,7 +2642,7 @@ if (!cluster.isPrimary) {
}); });
var modFunction = ffinals; var modFunction = ffinals;
proxyMods.slice().reverse().forEach(function (proxyMod) { proxyMods.reverse().forEach(function (proxyMod) {
modFunction = proxyMod.proxyCallback(req, socket, head, configJSON, serverconsole, modFunction); modFunction = proxyMod.proxyCallback(req, socket, head, configJSON, serverconsole, modFunction);
}); });
modFunction(); modFunction();
@ -3245,7 +3245,7 @@ if (!cluster.isPrimary) {
function modExecute(mods, ffinals) { function modExecute(mods, ffinals) {
// Prepare modFunction // Prepare modFunction
var modFunction = ffinals; var modFunction = ffinals;
var useMods = mods; var useMods = mods.slice();
if(isProxy) { if(isProxy) {
// Get list of forward proxy mods // 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); modFunction = modO.callback(req, res, serverconsole, responseEnd, href, ext, uobject, search, "index.html", users, page404, head, foot, "", modFunction, configJSON, callServerError, getCustomHeaders, origHref, redirect, parsePostData);
}); });