diff --git a/CHANGELOG.md b/CHANGELOG.md index 62d1c804..a20c32ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,8 @@ All notable changes to the Zlux Server Framework package will be documented in t This repo is part of the app-server Zowe Component, and the change logs here may appear on Zowe.org in that section. ## 2.14.0 -- Bugfix: A call to GET /plugins would trigger an authorization check regardless of if rbac was set on or off - +- Bugfix: App-server would not correctly detect when it was running in a high-availability configuration environment. (#521) +- Bugfix: A call to GET /plugins would trigger an authorization check regardless of if rbac was set on or off (#523) ## 2.13.0 - Added support for using zowe.network and components.app-server.zowe.network to set listener IP and TLS properties including max and min version, ciphers, and ECDH curves. (#511) diff --git a/lib/util.js b/lib/util.js index e8c66ad1..6360a04e 100644 --- a/lib/util.js +++ b/lib/util.js @@ -490,9 +490,11 @@ module.exports.getCookieName = (cookieIdentifier) => { return 'connect.sid.' + cookieIdentifier; } + +const HA_INSTANCE_COUNT=Object.keys(process.env).filter(key=>!key.match(/ZWE_haInstances_.*_components_.*hostname.*/)).filter(key=>key.match(/ZWE_haInstances_.*hostname/)).length; const isHaMode = module.exports.isHaMode = function () { - const haInstanceCount = +process.env['ZWE_HA_INSTANCES_COUNT']; - return (!isNaN(haInstanceCount) && haInstanceCount > 1); + let isHaMode = (!isNaN(HA_INSTANCE_COUNT) && HA_INSTANCE_COUNT > 1); + return isHaMode; } //TODO, ATTLS