Skip to content
Browse files

Fixed a bug in fu's handling of HEAD requests.

The fu.js code wasn't checking to see if a request method was HEAD.
That resulted in it sending a body to a head request.  This in turn
resulted in breaking the spec which the underlying Node library didn't
like.  In turn, this resulted in an uncaught exception which crashed the
server. Now if the request type is HEAD, it does the right thing.
  • Loading branch information...
1 parent 8ec8bb2 commit f5f9f1fa0b86674fc13ea96a86d400f61ef05a6c @bensonk bensonk committed with ry Jun 14, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 fu.js
View
2 fu.js
@@ -84,7 +84,7 @@ fu.staticHandler = function (filename) {
return function (req, res) {
loadResponseData(function () {
res.writeHead(200, headers);
- res.end(body);
+ res.end(req.method === "HEAD" ? "" : body);
});
}
};

0 comments on commit f5f9f1f

Please sign in to comment.
Something went wrong with that request. Please try again.