fix 'remote-addr' property in connect-logger

This commit is contained in:
Matthias Adler 2013-12-21 19:42:44 +01:00
parent d2f044a451
commit 2118d8f7b3

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