We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa96858 commit fd3aa03Copy full SHA for fd3aa03
lib/_http_client.js
@@ -70,7 +70,7 @@ function isInvalidPath(s) {
70
}
71
72
function validateHost(host, name) {
73
- if (host != null && typeof host !== 'string') {
+ if (host !== null && host !== undefined && typeof host !== 'string') {
74
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', `options.${name}`,
75
['string', 'undefined', 'null'], host);
76
@@ -145,7 +145,7 @@ function ClientRequest(options, cb) {
145
146
var method = options.method;
147
var methodIsString = (typeof method === 'string');
148
- if (method != null && !methodIsString) {
+ if (method !== null && method !== undefined && !methodIsString) {
149
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'method',
150
'string', method);
151
0 commit comments