kopia lustrzana https://github.com/FacilMap/facilmap
Respect proxy-forwarded IP in geoip lookup
rodzic
8c0e3d692e
commit
2b3f493146
|
@ -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) {
|
||||
|
|
Ładowanie…
Reference in New Issue