Respect proxy-forwarded IP in geoip lookup

pull/108/head
Candid Dauth 2018-09-26 19:38:57 +02:00
rodzic 8c0e3d692e
commit 2b3f493146
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -686,7 +686,8 @@ utils.extend(SocketConnection.prototype, {
},
async geoip() {
return await geoip.lookup(this.socket.request.connection.remoteAddress);
let ip = this.socket.handshake.headers["x-forwarded-for"] || this.socket.request.connection.remoteAddress;
return await geoip.lookup(ip);
}
/*copyPad : function(data, callback) {