Merge pull request #168 from macedigital/connectlogger-ip-fix

fix 'remote-addr' property in connect-logger
This commit is contained in:
Gareth Jones 2013-12-30 12:40:40 -08:00
commit a6efbf6273

View File

@ -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',