summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorseebees <seebees@gmail.com>2011-11-28 09:36:54 -0800
committerkoichik <koichik@improvement.jp>2011-11-29 16:52:15 +0900
commitaab958b7130280e4862ab72458d120d159f24fc1 (patch)
treeb47f36a8d8513bbbb6e972a6c616dc5e82a01485 /lib
parent1c62e807e105d8335bf96d2cd3db786ceff33782 (diff)
downloadnode-new-aab958b7130280e4862ab72458d120d159f24fc1.tar.gz
OutgoingMessage.prototype.write does not take Array
Changed the type checking for OutgoingMessage.prototype.write so it only accepts string and Buffer. And test. Fixes #2162 Fixes #2208
Diffstat (limited to 'lib')
-rw-r--r--lib/http.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/http.js b/lib/http.js
index 3040d33d6d..912e3da170 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -597,9 +597,8 @@ OutgoingMessage.prototype.write = function(chunk, encoding) {
return true;
}
- if (typeof chunk !== 'string' && !Buffer.isBuffer(chunk) &&
- !Array.isArray(chunk)) {
- throw new TypeError('first argument must be a string, Array, or Buffer');
+ if (typeof chunk !== 'string' && !Buffer.isBuffer(chunk)) {
+ throw new TypeError('first argument must be a string or Buffer');
}
if (chunk.length === 0) return false;