Allow equal sign within option values (#9402)

Closes #9397
This commit is contained in:
Pedro Igor 2022-01-11 00:21:38 -08:00 committed by GitHub
parent d75d28468e
commit cbfd989ca9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -172,7 +172,7 @@ public class ConfigArgsConfigSource extends PropertiesConfigSource {
continue;
}
String[] keyValue = ARG_KEY_VALUE_SPLIT.split(arg);
String[] keyValue = ARG_KEY_VALUE_SPLIT.split(arg, 2);
String key = keyValue[0];
if ("".equals(key.trim())) {

View file

@ -373,6 +373,13 @@ public class ConfigurationTest {
assertEquals("enabled", config.getConfigValue("quarkus.datasource.jdbc.transactions").getValue());
}
@Test
public void testOptionValueWithEqualSign() {
System.setProperty(CLI_ARGS, "--db-password=my_secret=");
SmallRyeConfig config = createConfig();
assertEquals("my_secret=", config.getConfigValue("kc.db.password").getValue());
}
private Config.Scope initConfig(String... scope) {
Config.init(new MicroProfileConfigProvider(createConfig()));
return Config.scope(scope);