Skip to content

Commit

Permalink
Fixed issue wherein a server will crash if it gets hit with a request…
Browse files Browse the repository at this point in the history
… missing a user agent such as google analytics
  • Loading branch information
robrighter committed May 1, 2010
1 parent a12a193 commit 304c0a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/node-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 304c0a5

Please sign in to comment.