From 2baad529056e453f00abc4a6497659a322800f65 Mon Sep 17 00:00:00 2001 From: Franziska Hinkelmann Date: Sat, 30 Jul 2016 20:44:23 +0200 Subject: [PATCH] lib: remove double check checkIsHttpToken() already checks for typeof string. We do not want to check twice. --- lib/_http_outgoing.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index f28aecae710cef..b06d04c5427226 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -338,8 +338,6 @@ OutgoingMessage.prototype.setHeader = function(name, value) { if (!common._checkIsHttpToken(name)) throw new TypeError( 'Header name must be a valid HTTP Token ["' + name + '"]'); - if (typeof name !== 'string') - throw new TypeError('"name" should be a string in setHeader(name, value)'); if (value === undefined) throw new Error('"value" required in setHeader("' + name + '", value)'); if (this._header)