Browse Source

set default encoding in sendBody

v0.7.4-release
Michaeljohn Clement 15 years ago
committed by Ryan Dahl
parent
commit
4e16e386fe
  1. 1
      lib/http.js

1
lib/http.js

@ -205,6 +205,7 @@ OutgoingMessage.prototype.sendHeaderLines = function (first_line, headers) {
}; };
OutgoingMessage.prototype.sendBody = function (chunk, encoding) { OutgoingMessage.prototype.sendBody = function (chunk, encoding) {
encoding = encoding || "ascii";
if (this.chunked_encoding) { if (this.chunked_encoding) {
this.send(process._byteLength(chunk, encoding).toString(16)); this.send(process._byteLength(chunk, encoding).toString(16));
this.send(CRLF); this.send(CRLF);

Loading…
Cancel
Save