From 2118d8f7b3d452ea8064a1f790d2cc88150c0fec Mon Sep 17 00:00:00 2001 From: Matthias Adler Date: Sat, 21 Dec 2013 19:42:44 +0100 Subject: [PATCH] fix 'remote-addr' property in connect-logger --- lib/connect-logger.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/connect-logger.js b/lib/connect-logger.js index a441be5..8c9e768 100644 --- a/lib/connect-logger.js +++ b/lib/connect-logger.js @@ -120,10 +120,10 @@ function format(str, req, res) { .replace(':referrer', req.headers.referer || req.headers.referrer || '') .replace(':http-version', req.httpVersionMajor + '.' + req.httpVersionMinor) .replace( - ':remote-addr', + ':remote-addr', req.ip || req._remoteAddress || ( req.socket && (req.socket.remoteAddress || (req.socket.socket && req.socket.socket.remoteAddress)) - ) + )) .replace(':user-agent', req.headers['user-agent'] || '') .replace( ':content-length',