Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't try to guess the response length, it's usually wrong and someti…

…mes causes errors.
  • Loading branch information...
commit 36a3a788142c04b6696da3114c51550d894fd7f1 1 parent 30ccb40
@creationix authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/node-router.js
View
4 lib/node-router.js
@@ -31,7 +31,7 @@ var url_parse = require("url").parse;
// Used as a simple, convient 404 handler.
function notFound(req, res, message) {
- message = message || "Not Found\n";
+ message = (message || "Not Found\n") + "";
res.writeHead(404, {
"Content-Type": "text/plain",
"Content-Length": message.length
@@ -49,7 +49,7 @@ function logify(req, res, logger) {
logger((req.socket && req.socket.remoteAddress) + " - - [" + (new Date()).toUTCString() + "]"
+ " \"" + req.method + " " + req.url
+ " HTTP/" + req.httpVersionMajor + "." + req.httpVersionMinor + "\" "
- + res.statusCode + " " + res.output[0].length + " \""
+ + res.statusCode + " - \""
+ (req.headers['referrer'] || "") + "\" \"" + req.headers["user-agent"].split(' ')[0] + "\"");
return end.apply(this, arguments);
}
Please sign in to comment.
Something went wrong with that request. Please try again.