diff --git a/index.js b/index.js index 0ed3413..6a59bbb 100644 --- a/index.js +++ b/index.js @@ -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 } });