diff options
Diffstat (limited to 'lib/https.js')
-rw-r--r-- | lib/https.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/https.js b/lib/https.js index 457327d6bb..fb22087259 100644 --- a/lib/https.js +++ b/lib/https.js @@ -34,6 +34,12 @@ const { urlToOptions, searchParamsSymbol } = require('internal/url'); function Server(opts, requestListener) { if (!(this instanceof Server)) return new Server(opts, requestListener); + if (typeof opts === 'function') { + requestListener = opts; + opts = undefined; + } + opts = util._extend({}, opts); + if (process.features.tls_npn && !opts.NPNProtocols) { opts.NPNProtocols = ['http/1.1', 'http/1.0']; } |