Fixed bug with too long URLs causing server to not respond. Also added support for exposeModsInErrorPages config.json property.

This commit is contained in:
Dorian Niemiec 2023-12-03 21:11:07 +01:00
parent 92242b757d
commit dfe13d711e

View file

@ -28,6 +28,8 @@ try {
}
var disableModExposeSupported = process.versions.svrjs && process.versions.svrjs.match(/^(?:Nightly-|(?:[4-9]|[123][0-9])[0-9]*\.|3\.(?:[1-9][0-9]+\.|9\.(?:[1-9])|4\.(?:(?:[3-9]|[12][0-9])[0-9]+|29)))/i);
function Mod() {}
Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, ext, uobject, search, defaultpage, users, page404, head, foot, fd, elseCallback, configJSON, callServerError, getCustomHeaders, origHref, redirect, parsePostData) {
@ -379,8 +381,9 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
req.socket.localPort,
getCustomHeaders ?
getCustomHeaders()["Server"] +
(disableModExposeSupported && (configJSON.exposeModsInErrorPages || configJSON.exposeModsInErrorPages === undefined) ?
" RedBrick/" +
version :
version : "") :
"SVR.JS/" +
configJSON.version +
" (" +
@ -429,8 +432,9 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
req.socket.localPort,
getCustomHeaders ?
getCustomHeaders()["Server"] +
(disableModExposeSupported && (configJSON.exposeModsInErrorPages || configJSON.exposeModsInErrorPages === undefined) ?
" RedBrick/" +
version :
version : "") :
"SVR.JS/" +
configJSON.version +
" (" +
@ -487,8 +491,9 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
req.socket.localPort,
getCustomHeaders ?
getCustomHeaders()["Server"] +
(disableModExposeSupported && (configJSON.exposeModsInErrorPages || configJSON.exposeModsInErrorPages === undefined) ?
" RedBrick/" +
version :
version : "") :
"SVR.JS/" +
configJSON.version +
" (" +
@ -543,8 +548,9 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
req.socket.localPort,
getCustomHeaders ?
getCustomHeaders()["Server"] +
(disableModExposeSupported && (configJSON.exposeModsInErrorPages || configJSON.exposeModsInErrorPages === undefined) ?
" RedBrick/" +
version :
version : "") :
"SVR.JS/" +
configJSON.version +
" (" +
@ -623,8 +629,9 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
req.socket.localPort,
getCustomHeaders ?
getCustomHeaders()["Server"] +
(disableModExposeSupported && (configJSON.exposeModsInErrorPages || configJSON.exposeModsInErrorPages === undefined) ?
" RedBrick/" +
version :
version : "") :
"SVR.JS/" +
configJSON.version +
" (" +
@ -665,7 +672,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
}
}
});
} else if (err && err.code == "ENOENT") {
} else {
elseCallback(); //Invoke default error handler
}
});