Permalink
Browse files

Fixed issue wherein a server will crash if it gets hit with a request…

… missing a user agent such as google analytics
  • Loading branch information...
1 parent a12a193 commit 304c0a56e819b583d10368f7c4b5dd912dc32926 robrighter committed May 1, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/node-router.js
View
@@ -50,7 +50,7 @@ function logify(req, res, logger) {
+ " \"" + req.method + " " + req.url
+ " HTTP/" + req.httpVersionMajor + "." + req.httpVersionMinor + "\" "
+ res.statusCode + " - \""
- + (req.headers['referer'] || "") + "\" \"" + req.headers["user-agent"].split(' ')[0] + "\"");
+ + (req.headers['referer'] || "") + "\" \"" + (req.headers["user-agent"] ? req.headers["user-agent"].split(' ')[0] : '') + "\"");
return end.apply(this, arguments);
}
var writeHead = res.writeHead;

0 comments on commit 304c0a5

Please sign in to comment.