Fixed bug with remote port property
This commit is contained in:
parent
534edc1eb8
commit
c85491150f
2 changed files with 9 additions and 3 deletions
10
index.js
10
index.js
|
@ -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") {
|
||||
|
|
2
mod.info
2
mod.info
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"name": "DorianTech YellowSquare JSGI engine for SVR.JS",
|
||||
"version": "1.0.1"
|
||||
"version": "1.0.2"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue