Look for visitor IP address on X-Forwarded-For header

pull/7554/head
Diego Sampaio 9 years ago
parent ea5a319a5e
commit fa911915fc
No known key found for this signature in database
GPG Key ID: E060152B30502562
  1. 2
      packages/rocketchat-livechat/server/lib/Livechat.js

@ -127,7 +127,7 @@ RocketChat.Livechat = {
if (this.connection) {
userData.userAgent = this.connection.httpHeaders['user-agent'];
userData.ip = this.connection.httpHeaders['x-real-ip'] || this.connection.clientAddress;
userData.ip = this.connection.httpHeaders['x-real-ip'] || this.connection.httpHeaders['x-forwarded-for'] || this.connection.clientAddress;
userData.host = this.connection.httpHeaders.host;
}

Loading…
Cancel
Save