Fix: Avoid loading all the environment variables as configurations when override_with_env_vars = true

This commit is contained in:
Andrea Peruffo 2020-05-07 18:28:56 +01:00
parent 44f21c31b9
commit 379a1f056c
2 changed files with 5 additions and 1 deletions

View File

@ -371,7 +371,7 @@ public class ConfigImpl {
private static AbstractConfigObject loadEnvVariablesOverrides() {
Map<String, String> env = new HashMap(System.getenv());
Map<String, String> result = new HashMap(System.getenv());
Map<String, String> result = new HashMap();
for (String key : env.keySet()) {
if (key.startsWith(ENV_VAR_OVERRIDE_PREFIX)) {

View File

@ -1135,6 +1135,10 @@ class ConfigTest extends TestUtils {
assertEquals(3, conf02.getInt("a-c"))
assertEquals(4, conf02.getInt("a_c"))
intercept[ConfigException.Missing] {
conf02.getInt("CONFIG_FORCE_a_b_c")
}
assertEquals("foo", conf04.getString("akka.version"))
assertEquals(10, conf04.getInt("akka.event-handler-dispatcher.max-pool-size"))
} finally {