set default encoding in sendBody

This commit is contained in:
Michaeljohn Clement
2010-01-19 15:20:26 -05:00
committed by Ryan Dahl
parent 6e3d12f617
commit 4e16e386fe

View File

@@ -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);