diff --git a/lib/http.js b/lib/http.js index 1144f0b64b..32bec0d590 100644 --- a/lib/http.js +++ b/lib/http.js @@ -205,6 +205,7 @@ OutgoingMessage.prototype.sendHeaderLines = function (first_line, headers) { }; OutgoingMessage.prototype.sendBody = function (chunk, encoding) { + encoding = encoding || "ascii"; if (this.chunked_encoding) { this.send(process._byteLength(chunk, encoding).toString(16)); this.send(CRLF);