|
@ -10,6 +10,7 @@ function debug (x) { |
|
|
var sys = require('sys'); |
|
|
var sys = require('sys'); |
|
|
var net = require('net'); |
|
|
var net = require('net'); |
|
|
var events = require('events'); |
|
|
var events = require('events'); |
|
|
|
|
|
var Buffer = require('buffer').Buffer; |
|
|
|
|
|
|
|
|
var FreeList = require('freelist').FreeList; |
|
|
var FreeList = require('freelist').FreeList; |
|
|
var HTTPParser = process.binding('http_parser').HTTPParser; |
|
|
var HTTPParser = process.binding('http_parser').HTTPParser; |
|
@ -345,6 +346,12 @@ OutgoingMessage.prototype.write = function (chunk, encoding) { |
|
|
throw new Error("This type of response MUST NOT have a body."); |
|
|
throw new Error("This type of response MUST NOT have a body."); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (typeof chunk !== "string" |
|
|
|
|
|
&& !(chunk instanceof Buffer) |
|
|
|
|
|
&& !Array.isArray(chunk)) { |
|
|
|
|
|
throw new TypeError("first argument must be a string, Array, or Buffer"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
encoding = encoding || "ascii"; |
|
|
encoding = encoding || "ascii"; |
|
|
if (this.chunkedEncoding) { |
|
|
if (this.chunkedEncoding) { |
|
|
if (typeof chunk == 'string') { |
|
|
if (typeof chunk == 'string') { |
|
|