Fix double "?" in the REQUEST_URL environment variable when URL rewriting is used
This commit is contained in:
parent
f8234d0d1c
commit
c78859d699
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
@ -251,7 +251,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
||||||
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 ? ((process.cwd() + 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["REQUEST_METHOD"] = req.method;
|
||||||
nEnv["SCGI"] = "1";
|
nEnv["SCGI"] = "1";
|
||||||
nEnv["REQUEST_URI"] = (!origHref || origHref == href) ? req.url : (origHref + (uobject.search ? ("?" + uobject.search) : ""));
|
nEnv["REQUEST_URI"] = (!origHref || origHref == href) ? req.url : (origHref + (uobject.search ? ((uobject.search[0] == "?" ? "" : "?") + 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_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, "");
|
||||||
if(req.socket.realRemoteAddress && req.socket.realRemotePort) {
|
if(req.socket.realRemoteAddress && req.socket.realRemotePort) {
|
||||||
nEnv["REMOTE_PORT"] = req.socket.realRemotePort;
|
nEnv["REMOTE_PORT"] = req.socket.realRemotePort;
|
||||||
|
|
Loading…
Reference in a new issue