Skip to content
Snippets Groups Projects
Commit 1f724ecf authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

log x-real-ip rather than remote ip in metrics stuff to get the proper ip in...

log x-real-ip rather than remote ip in metrics stuff to get the proper ip in anonymous metrics logs.  closes #391
parent 85cba543
No related branches found
No related tags found
No related merge requests found
......@@ -108,10 +108,13 @@ exports.report = function(type, entry) {
// utility function to log a bunch of stuff at user entry point
exports.userEntry = function(req) {
var ipAddress = req.connection.remoteAddress;
if (req.headers['x-real-ip']) ipAddress = req.headers['x-real-ip'];
exports.report('signin', {
browser: req.headers['user-agent'],
rp: req.headers['referer'],
// IP address (this probably needs to be replaced with the X-forwarded-for value
ip: req.connection.remoteAddress
ip: ipAddress
});
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment