From 477f8ebf3092abd460b4f7ffc54f62922c91a4ef Mon Sep 17 00:00:00 2001 From: Szymon Marczak <36894700+szmarczak@users.noreply.github.com> Date: Fri, 27 Aug 2021 18:18:49 +0200 Subject: [PATCH] 2.1.6 --- package.json | 2 +- source/auto.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3671548..efa9dd5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "http2-wrapper", - "version": "2.1.5", + "version": "2.1.6", "description": "HTTP2 client, just with the familiar `https` API", "main": "source", "types": "index.d.ts", diff --git a/source/auto.js b/source/auto.js index d1d90e4..6085d0d 100644 --- a/source/auto.js +++ b/source/auto.js @@ -124,7 +124,7 @@ module.exports = async (input, options, callback) => { options.host = options.hostname || options.host || 'localhost'; options.session = options.tlsSession; - options.servername = options.servername || calculateServerName(options.headers?.host || options.host); + options.servername = options.servername || calculateServerName((options.headers && options.headers.host) || options.host); options.port = options.port || (isHttps ? 443 : 80); options._defaultAgent = isHttps ? https.globalAgent : http.globalAgent;