Added support for exposeModsInErrorPages config.json property.

This commit is contained in:
Dorian Niemiec 2023-12-31 21:38:23 +01:00
parent fd10bb6409
commit 4e5ab8184d

View file

@ -31,6 +31,8 @@ scgiConf.path = scgiConf.path.replace(/([^\/])\/+$/, "$1");
if (scgiConf.host === undefined) scgiConf.host = "localhost"; if (scgiConf.host === undefined) scgiConf.host = "localhost";
if (scgiConf.port === undefined) scgiConf.port = 4000; if (scgiConf.port === undefined) scgiConf.port = 4000;
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() {} 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) { 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) {
@ -237,8 +239,9 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
req.socket.localPort, req.socket.localPort,
getCustomHeaders ? getCustomHeaders ?
getCustomHeaders()["Server"] + getCustomHeaders()["Server"] +
(disableModExposeSupported && (configJSON.exposeModsInErrorPages || configJSON.exposeModsInErrorPages === undefined) ?
" OrangeCircle/" + " OrangeCircle/" +
version : version : "") :
"SVR.JS/" + "SVR.JS/" +
configJSON.version + configJSON.version +
" (" + " (" +