Skip to content

Commit 1f71164

Browse files
authored
fixes #2154 we need to load both decryped yaml and undecryped yaml from config server (#2156)
1 parent fcd3a59 commit 1f71164

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/main/java/com/networknt/server/DefaultConfigLoader.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ private synchronized void loadConfigs(String queryParameters) {
212212
// pass serviceConfigs through Config.yaml's load method so that it can decrypt any encrypted values
213213
DumperOptions options = new DumperOptions();
214214
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);//to get yaml string without curly brackets and commas
215-
serviceConfigs = Config.getInstance().getYaml().load(new Yaml(options).dump(serviceConfigs));
215+
// serviceConfigs = Config.getInstance().getYaml().load(new Yaml(options).dump(serviceConfigs));
216216

217217
// save the values.yml to the target folder. This is for the case of reload to overwrite and start without config server.
218218
try {
@@ -334,7 +334,7 @@ private Map<String, Object> getServiceConfigs(String configServerPath) {
334334
configs = JsonMapper.string2Map(body);
335335
processNestedMap(configs);
336336
} else if(contentType.get().startsWith(ContentType.APPLICATION_YAML.value())) {
337-
configs = Config.getInstance().getYaml().load(body);
337+
configs = Config.getNoneDecryptedInstance().getYaml().load(body);
338338
} else {
339339
// the content type is not supported, throw an exception.
340340
logger.error("The content type {} in the response from the config server is not supported.", contentType.get());

0 commit comments

Comments
 (0)