From 5ac5f3c9b7e5bf24f2c9cb16647db332e6cce3bc Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Mon, 21 Aug 2023 20:21:32 +0200 Subject: [PATCH] Add HTTPS environment value support --- index.js | 1 + mod.info | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a1d2614..146e4f7 100644 --- a/index.js +++ b/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"]; diff --git a/mod.info b/mod.info index d34c4e0..d460e8d 100755 --- a/mod.info +++ b/mod.info @@ -1,4 +1,4 @@ { "name": "DorianTech OrangeCircle SCGI client for SVR.JS", - "version": "1.0.2" + "version": "1.0.3" }