File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ function isInvalidPath(s) {
70
70
}
71
71
72
72
function validateHost ( host , name ) {
73
- if ( host != null && typeof host !== 'string' ) {
73
+ if ( host !== null && host !== undefined && typeof host !== 'string' ) {
74
74
throw new errors . TypeError ( 'ERR_INVALID_ARG_TYPE' , `options.${ name } ` ,
75
75
[ 'string' , 'undefined' , 'null' ] , host ) ;
76
76
}
@@ -145,7 +145,7 @@ function ClientRequest(options, cb) {
145
145
146
146
var method = options . method ;
147
147
var methodIsString = ( typeof method === 'string' ) ;
148
- if ( method != null && ! methodIsString ) {
148
+ if ( method !== null && method !== undefined && ! methodIsString ) {
149
149
throw new errors . TypeError ( 'ERR_INVALID_ARG_TYPE' , 'method' ,
150
150
'string' , method ) ;
151
151
}
You can’t perform that action at this time.
0 commit comments