chore: release OrangeCircle 1.3.1
This commit is contained in:
parent
9c85310a44
commit
90e0479f92
2 changed files with 19 additions and 4 deletions
21
index.js
21
index.js
|
@ -41,6 +41,19 @@ if (typeof scgiConfO.multiConfig == "object" && scgiConfO.multiConfig !== null)
|
|||
}
|
||||
|
||||
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);
|
||||
var normalizedWebrootSupported = process.versions.svrjs && process.versions.svrjs.match(/^(?:Nightly-|(?:[5-9]|[1234][0-9])[0-9]*\.|4\.(?:(?:[1][0-9]|[2-9])+\.))/i);
|
||||
|
||||
function normalizeWebroot(currentWebroot) {
|
||||
if (currentWebroot === undefined) {
|
||||
return process.cwd();
|
||||
} else if (!path.isAbsolute(currentWebroot)) {
|
||||
return (
|
||||
process.cwd() + (os.platform() == "win32" ? "\\" : "/") + currentWebroot
|
||||
);
|
||||
} else {
|
||||
return currentWebroot;
|
||||
}
|
||||
}
|
||||
|
||||
function Mod() {}
|
||||
|
||||
|
@ -50,6 +63,8 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
|||
configJSON = configJSONS;
|
||||
}
|
||||
|
||||
var detectedWwwroot = normalizedWebrootSupported ? normalizeWebroot(configJSON.wwwroot) : process.cwd();
|
||||
|
||||
function checkIfThereIsA401Rule() {
|
||||
var actually401 = false;
|
||||
|
||||
|
@ -254,10 +269,10 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
|||
nEnv["SERVER_ADMIN"] = configJSON.serverAdministratorEmail;
|
||||
}
|
||||
nEnv["SERVER_NAME"] = req.headers.host;
|
||||
nEnv["DOCUMENT_ROOT"] = process.cwd();
|
||||
nEnv["DOCUMENT_ROOT"] = detectedWwwroot;
|
||||
nEnv["SCRIPT_NAME"] = scgiConf.path;
|
||||
nEnv["PATH_INFO"] = decodeURIComponent(b);
|
||||
nEnv["PATH_TRANSLATED"] = b ? ((process.cwd() + decodeURIComponent(require("os").platform == "win32" ? b.replace(/\//g, "\\") : b)).replace((require("os").platform == "win32" ? /\\\\/g : /\/\//g), (require("os").platform == "win32" ? "\\" : "/"))) : "";
|
||||
nEnv["PATH_TRANSLATED"] = b ? ((detectedWwwroot + decodeURIComponent(require("os").platform == "win32" ? b.replace(/\//g, "\\") : b)).replace((require("os").platform == "win32" ? /\\\\/g : /\/\//g), (require("os").platform == "win32" ? "\\" : "/"))) : "";
|
||||
nEnv["REQUEST_METHOD"] = req.method;
|
||||
nEnv["SCGI"] = "1";
|
||||
nEnv["REQUEST_URI"] = (!origHref || origHref == href) ? req.url : (origHref + (uobject.search ? ((uobject.search[0] == "?" ? "" : "?") + uobject.search) : ""));
|
||||
|
@ -351,7 +366,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
|||
callServerError(500, "OrangeCircle/" + version, ex);
|
||||
}
|
||||
}
|
||||
} else if ((href == "/orangecircle-config.json" || (os.platform() == "win32" && href.toLowerCase() == "/orangecircle-config.json")) && path.normalize(__dirname + "/../../..") == process.cwd()) {
|
||||
} else if ((href == "/orangecircle-config.json" || (os.platform() == "win32" && href.toLowerCase() == "/orangecircle-config.json")) && path.normalize(__dirname + "/../../..") == detectedWwwroot) {
|
||||
if (!callServerError) {
|
||||
res.writeHead(200, "OK", {
|
||||
"Content-Type": "application/json",
|
||||
|
|
2
mod.info
2
mod.info
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"name": "OrangeCircle SCGI client for SVR.JS",
|
||||
"version": "1.3.0"
|
||||
"version": "1.3.1"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue