File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ const errors = require('internal/errors');
44
44
const INVALID_PATH_REGEX = / [ ^ \u0021 - \u00ff ] / ;
45
45
46
46
function validateHost ( host , name ) {
47
- if ( host != null && typeof host !== 'string' ) {
47
+ if ( host !== null && host !== undefined && typeof host !== 'string' ) {
48
48
throw new errors . TypeError ( 'ERR_INVALID_ARG_TYPE' , `options.${ name } ` ,
49
49
[ 'string' , 'undefined' , 'null' ] , host ) ;
50
50
}
@@ -113,7 +113,7 @@ function ClientRequest(options, cb) {
113
113
114
114
var method = options . method ;
115
115
var methodIsString = ( typeof method === 'string' ) ;
116
- if ( method != null && ! methodIsString ) {
116
+ if ( method !== null && method !== undefined && ! methodIsString ) {
117
117
throw new errors . TypeError ( 'ERR_INVALID_ARG_TYPE' , 'method' ,
118
118
'string' , method ) ;
119
119
}
You can’t perform that action at this time.
0 commit comments