From 9acd76ed6e020fa540f64eabf4bdb33513795924 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 12 Aug 2010 10:06:52 -0700 Subject: [PATCH] Don't throw on HEAD requests --- lib/http.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/http.js b/lib/http.js index fee73d2b02..5b67e43817 100644 --- a/lib/http.js +++ b/lib/http.js @@ -433,7 +433,8 @@ OutgoingMessage.prototype.write = function (chunk, encoding) { } if (!this._hasBody) { - throw new Error("This type of response MUST NOT have a body."); + console.error("This type of response MUST NOT have a body. Ignoring write() calls."); + return true; } if (typeof chunk !== "string"