Skip to content

Commit

Permalink
lib: remove double check of string type
Browse files Browse the repository at this point in the history
checkIsHttpToken() already checks for typeof string. We do not
want to check twice.

PR-URL: #7985
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
fhinkel authored and cjihrig committed Aug 10, 2016
1 parent 7d0e5a0 commit 7dc66f8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7dc66f8

Please sign in to comment.