Skip to content

Commit

Permalink
Fix: Avoid loading all the environment variables as configurations wh…
Browse files Browse the repository at this point in the history
…en override_with_env_vars = true
  • Loading branch information
andreaTP committed May 7, 2020
1 parent 44f21c3 commit 379a1f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public static void reloadEnvVariablesConfig() {

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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 379a1f0

Please sign in to comment.