Permalink
Browse files

dont die on HEAD requests

  • Loading branch information...
1 parent b56f626 commit 5cf18601474cadfdfda7729c29754354544b4243 @mhansen committed Jun 20, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/antinode.js
View
@@ -121,6 +121,8 @@ function handle_request(path, req, resp) {
return not_modified();
}
else stream_file(path, stats);
+ } else if (req.method == 'HEAD') {
+ finish(resp);
} else {
return stream_file(path, stats);
}
@@ -171,7 +173,9 @@ function handle_request(path, req, resp) {
log.debug("404 opening path: '"+path+"'");
var body = "404: " + req.url + " not found.\n";
send_headers(404,body.length,"text/plain");
- resp.write(body);
+ if (req.method != 'HEAD') {
+ resp.write(body);
+ }
finish(resp);
}

0 comments on commit 5cf1860

Please sign in to comment.