diff --git a/components/connection.js b/components/connection.js index c390520..e1aabda 100644 --- a/components/connection.js +++ b/components/connection.js @@ -147,6 +147,7 @@ function readOptionsFromEnv () { environmentOptions.secure = protocol === 'https:' environmentOptions.host = hostname environmentOptions.port = port + environmentOptions.protocol = protocol } return environmentOptions diff --git a/spec/tests/readenv.js b/spec/tests/readenv.js index 7c818ec..c2e0ef6 100644 --- a/spec/tests/readenv.js +++ b/spec/tests/readenv.js @@ -12,10 +12,12 @@ test('connection options from environment', function (t) { t.equal(optionsFromEnv.port, port) t.equal(optionsFromEnv.secure, protocol === 'https:') t.equal(optionsFromEnv.host, hostname) + t.equal(optionsFromEnv.protocol, protocol) } else { t.false('port' in optionsFromEnv) t.false('secure' in optionsFromEnv) t.false('host' in optionsFromEnv) + t.false('protocol' in optionsFromEnv) } if (userIsSet) {