diff options
Diffstat (limited to 'lib/https.js')
-rw-r--r-- | lib/https.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/https.js b/lib/https.js index acbbe0b6c2..4ee15b2537 100644 --- a/lib/https.js +++ b/lib/https.js @@ -4,7 +4,7 @@ const tls = require('tls'); const url = require('url'); const http = require('http'); const util = require('util'); -const inherits = require('util').inherits; +const inherits = util.inherits; const debug = util.debuglog('https'); function Server(opts, requestListener) { @@ -41,21 +41,21 @@ exports.createServer = function(opts, requestListener) { // HTTPS agents. function createConnection(port, host, options) { - if (util.isObject(port)) { + if (port !== null && typeof port === 'object') { options = port; - } else if (util.isObject(host)) { + } else if (host !== null && typeof host === 'object') { options = host; - } else if (util.isObject(options)) { + } else if (options !== null && typeof options === 'object') { options = options; } else { options = {}; } - if (util.isNumber(port)) { + if (typeof port === 'number') { options.port = port; } - if (util.isString(host)) { + if (typeof host === 'string') { options.host = host; } @@ -96,7 +96,7 @@ Agent.prototype.getName = function(options) { name += options.pfx; name += ':'; - if (!util.isUndefined(options.rejectUnauthorized)) + if (options.rejectUnauthorized !== undefined) name += options.rejectUnauthorized; return name; @@ -108,7 +108,7 @@ exports.globalAgent = globalAgent; exports.Agent = Agent; exports.request = function(options, cb) { - if (util.isString(options)) { + if (typeof options === 'string') { options = url.parse(options); } else { options = util._extend({}, options); |