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"