Fixed bug with remote port property
This commit is contained in:
parent
4504450365
commit
d1bf62ec71
1 changed files with 8 additions and 2 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") {
|
||||
|
|
Loading…
Reference in a new issue