From 4e5ab8184d6a38103aa166451838120c9f7b27ce Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sun, 31 Dec 2023 21:38:23 +0100 Subject: [PATCH] Added support for exposeModsInErrorPages config.json property. --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index d8d4b19..50929dc 100644 --- a/index.js +++ b/index.js @@ -31,6 +31,8 @@ scgiConf.path = scgiConf.path.replace(/([^\/])\/+$/, "$1"); if (scgiConf.host === undefined) scgiConf.host = "localhost"; 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() {} 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, getCustomHeaders ? getCustomHeaders()["Server"] + + (disableModExposeSupported && (configJSON.exposeModsInErrorPages || configJSON.exposeModsInErrorPages === undefined) ? " OrangeCircle/" + - version : + version : "") : "SVR.JS/" + configJSON.version + " (" +