Skip to content

Commit

Permalink
Request logger should not show "undefined" for remoteAddress ever
Browse files Browse the repository at this point in the history
  • Loading branch information
jfhbrook committed Aug 18, 2013
1 parent 615a37c commit 60d195e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion request-logger.js
Expand Up @@ -20,7 +20,8 @@ module.exports = function requestLogger(req, res, next) {
if (req.ip) return req.ip;
var sock = req.socket;
if (sock.socket) return sock.socket.remoteAddress;
return sock.remoteAddress;
if (sock.remoteAddress) return sock.remoteAddress;
return ' - ';
})(),
date = new Date().toUTCString(), // DEFINITELY not CLF-compatible.
method = req.method,
Expand Down

0 comments on commit 60d195e

Please sign in to comment.