mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 20:13:07 +00:00
Fix webirc and 4-in-6 addresses
This commit is contained in:
parent
a7fe19deca
commit
d42ac23c55
1 changed files with 6 additions and 2 deletions
|
@ -70,11 +70,15 @@ module.exports = function() {
|
|||
};
|
||||
|
||||
function getClientIp(req) {
|
||||
var ip;
|
||||
|
||||
if (!Helper.config.reverseProxy) {
|
||||
return req.connection.remoteAddress;
|
||||
ip = req.connection.remoteAddress;
|
||||
} else {
|
||||
return req.headers["x-forwarded-for"] || req.connection.remoteAddress;
|
||||
ip = req.headers["x-forwarded-for"] || req.connection.remoteAddress;
|
||||
}
|
||||
|
||||
return ip.replace(/^::ffff:/, "");
|
||||
}
|
||||
|
||||
function allRequests(req, res, next) {
|
||||
|
|
Loading…
Reference in a new issue