Add HTTPS environment value support
This commit is contained in:
parent
a2c23e0245
commit
ecea581f29
1 changed files with 1 additions and 0 deletions
1
index.js
1
index.js
|
@ -200,6 +200,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
|||
nEnv["REQUEST_URI"] = (!origHref || origHref == href) ? req.url : (origHref + (uobject.search ? ("?" + uobject.search) : ""));
|
||||
nEnv["REMOTE_ADDR"] = (req.socket.realRemoteAddress ? req.socket.realRemoteAddress : ((req.headers["x-forwarded-for"] && configJSON.enableIPSpoofing) ? req.headers["x-forwarded-for"].split(",")[0].replace(/ /g, "") : req.socket.remoteAddress)).replace(/^::ffff:/i, "");
|
||||
nEnv["REMOTE_PORT"] = (req.socket.realRemotePort ? req.socket.realRemotePort : req.socket.remotePort);
|
||||
if (req.socket.encrypted) nEnv["HTTPS"] = "ON";
|
||||
if (req.headers["content-type"]) nEnv["CONTENT_TYPE"] = req.headers["content-type"];
|
||||
nEnv["CONTENT_LENGTH"] = "0";
|
||||
if (req.headers["content-length"]) nEnv["CONTENT_LENGTH"] = req.headers["content-length"];
|
||||
|
|
Loading…
Reference in a new issue