Fixed bug with remote port property

This commit is contained in:
Dorian Niemiec 2023-09-03 11:27:41 +02:00
parent 534edc1eb8
commit c85491150f
2 changed files with 9 additions and 3 deletions

View file

@ -161,9 +161,15 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
ext: {}
},
serverSoftware: software,
remoteAddr: (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, ""),
remotePost: (req.socket.realRemotePort ? req.socket.realRemotePort : req.socket.remotePort)
remoteAddr: (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) {
jsgiRequestObject.remotePort = req.socket.realRemotePort;
} else if(!(req.socket.realRemoteAddress && !req.socket.realRemotePort)) {
jsgiRequestObject.remotePort = req.socket.remotePort;
}
if (req.headers.authorization) {
jsgiRequestObject.authType = req.headers.authorization.split(" ")[0];
if (jsgiRequestObject.authType == "Basic") {

View file

@ -1,4 +1,4 @@
{
"name": "DorianTech YellowSquare JSGI engine for SVR.JS",
"version": "1.0.1"
"version": "1.0.2"
}