Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5164a12

Browse files
leeseeanBridgeAR
authored andcommittedJan 21, 2018
http: use strict comparison
PR-URL: #17011 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
1 parent 7d2b08a commit 5164a12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎lib/_http_client.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const errors = require('internal/errors');
4444
const INVALID_PATH_REGEX = /[^\u0021-\u00ff]/;
4545

4646
function validateHost(host, name) {
47-
if (host != null && typeof host !== 'string') {
47+
if (host !== null && host !== undefined && typeof host !== 'string') {
4848
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', `options.${name}`,
4949
['string', 'undefined', 'null'], host);
5050
}
@@ -113,7 +113,7 @@ function ClientRequest(options, cb) {
113113

114114
var method = options.method;
115115
var methodIsString = (typeof method === 'string');
116-
if (method != null && !methodIsString) {
116+
if (method !== null && method !== undefined && !methodIsString) {
117117
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'method',
118118
'string', method);
119119
}

0 commit comments

Comments
 (0)
Please sign in to comment.