From 89ebd8f48d545785aafe531213ed984847a2b3f0 Mon Sep 17 00:00:00 2001 From: Peter Svetlichny Date: Tue, 6 Feb 2018 16:03:17 -0800 Subject: [PATCH] fix(config): move ssl env logic --- lib/config/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/config/index.js b/lib/config/index.js index 41d01fb723..42fb880d23 100644 --- a/lib/config/index.js +++ b/lib/config/index.js @@ -1054,11 +1054,6 @@ Config.prototype._fromEnvironment = function _fromEnvironment(metadata, data) { return } - if (value === 'ssl' && !isTruthular(metadata.ssl)) { - logger.warn('SSL config key can no longer be disabled, not updating.') - return - } - var node = metadata[value] if (typeof node === 'string') { var setting = process.env[node] @@ -1070,6 +1065,10 @@ Config.prototype._fromEnvironment = function _fromEnvironment(metadata, data) { } else if (OBJECT_LIST_VARS.indexOf(node) > -1) { data[value] = fromObjectList(setting) } else if (BOOLEAN_VARS.indexOf(node) > -1) { + if (value === 'ssl' && !isTruthular(setting)) { + logger.warn('SSL config key can no longer be disabled, not updating.') + return + } data[value] = isTruthular(setting) } else if (FLOAT_VARS.indexOf(node) > -1) { data[value] = parseFloat(setting, 10)