Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed HEAD support for 404s and 500s

  • Loading branch information...
commit f097591c7732d72be0914764de2f089981405be9 1 parent 289db14
@tj tj authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  lib/http.js
View
2  lib/http.js
@@ -163,10 +163,12 @@ Server.prototype.handle = function(req, res, out) {
res.statusCode = 500;
res.setHeader('Content-Type', 'text/plain');
+ if ('HEAD' == req.method) return res.end();
res.end(msg);
} else {
res.statusCode = 404;
res.setHeader('Content-Type', 'text/plain');
+ if ('HEAD' == req.method) return res.end();
res.end('Cannot ' + req.method + ' ' + req.url);
}
return;
Please sign in to comment.
Something went wrong with that request. Please try again.