From 6a57a42109503b5327c4ffca20fe4048103c3b80 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 14 Jul 2010 14:29:28 -0700 Subject: [PATCH] Use Array.isArray instead of instanceof --- lib/http.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/http.js b/lib/http.js index 1f3537b651..66869740ec 100644 --- a/lib/http.js +++ b/lib/http.js @@ -359,7 +359,7 @@ OutgoingMessage.prototype._storeHeader = function (firstLine, headers) { if (headers) { var keys = Object.keys(headers); - var isArray = (headers instanceof Array); + var isArray = (Array.isArray(headers)); for (var i = 0, l = keys.length; i < l; i++) { var key = keys[i]; if (isArray) { @@ -1036,7 +1036,7 @@ exports.cat = function (url, encoding_, headers_) { var url = require("url").parse(url); var hasHost = false; - if (headers instanceof Array) { + if (Array.isArray(headers)) { for (var i = 0, l = headers.length; i < l; i++) { if (headers[i][0].toLowerCase() === 'host') { hasHost = true;