Skip to content

Commit 35109dd

Browse files
fhinkeljasnell
authored andcommitted
lib: remove double check of string type
checkIsHttpToken() already checks for typeof string. We do not want to check twice. PR-URL: #7985 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent accaa34 commit 35109dd

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/_http_outgoing.js

-2
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,6 @@ OutgoingMessage.prototype.setHeader = function(name, value) {
338338
if (!common._checkIsHttpToken(name))
339339
throw new TypeError(
340340
'Header name must be a valid HTTP Token ["' + name + '"]');
341-
if (typeof name !== 'string')
342-
throw new TypeError('"name" should be a string in setHeader(name, value)');
343341
if (value === undefined)
344342
throw new Error('"value" required in setHeader("' + name + '", value)');
345343
if (this._header)

0 commit comments

Comments
 (0)