Skip to content

Commit

Permalink
http: use strict comparison
Browse files Browse the repository at this point in the history
PR-URL: #17011
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
  • Loading branch information
leeseean authored and evanlucas committed Jan 30, 2018
1 parent aa96858 commit fd3aa03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function isInvalidPath(s) {
}

function validateHost(host, name) {
if (host != null && typeof host !== 'string') {
if (host !== null && host !== undefined && typeof host !== 'string') {
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', `options.${name}`,
['string', 'undefined', 'null'], host);
}
Expand Down Expand Up @@ -145,7 +145,7 @@ function ClientRequest(options, cb) {

var method = options.method;
var methodIsString = (typeof method === 'string');
if (method != null && !methodIsString) {
if (method !== null && method !== undefined && !methodIsString) {
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'method',
'string', method);
}
Expand Down

0 comments on commit fd3aa03

Please sign in to comment.