From f91f2ef213613439aca57eca7e5b66ed8d3276d7 Mon Sep 17 00:00:00 2001 From: Alex Bogdanovski Date: Mon, 22 Apr 2024 16:52:05 +0300 Subject: [PATCH] added support for uppercase ENV variables, closes Erudika/scoold#452 --- .../src/main/java/com/erudika/para/core/utils/Config.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/para-core/src/main/java/com/erudika/para/core/utils/Config.java b/para-core/src/main/java/com/erudika/para/core/utils/Config.java index c9e937cc..7526a0d3 100644 --- a/para-core/src/main/java/com/erudika/para/core/utils/Config.java +++ b/para-core/src/main/java/com/erudika/para/core/utils/Config.java @@ -253,7 +253,8 @@ protected String getConfigParam(String key, String defaultValue) { if (StringUtils.isBlank(key)) { return defaultValue; } - String env = System.getenv(getConfigRootPrefix() + "_" + key.replaceAll("\\.", "_")); + String envKey = getConfigRootPrefix() + "_" + key.replaceAll("\\.", "_"); + String env = System.getenv().getOrDefault(envKey.toUpperCase(), System.getenv(envKey)); // support uppercase ENV vars String sys = System.getProperty(getConfigRootPrefix() + "." + key); if (!StringUtils.isBlank(sys)) { return sys;