Skip to content

Commit f715bbb

Browse files
authored
Fix potentially invalid YAML outputs
Fixes invalid YAML caused by the combination of `?resolvePlaceholders=true` and `spring.cloud.config.server.encrypt.enabled = false` Signed-off-by: Zachary Sistrunk <zachary@sistrunk.dev>
1 parent 265ca48 commit f715bbb

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/EnvironmentController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ public ResponseEntity<String> labelledYaml(@PathVariable String name, @PathVaria
228228

229229
if (resolvePlaceholders) {
230230
yaml = resolvePlaceholders(prepareEnvironment(environment), yaml);
231+
yaml = yaml.replaceAll(": \\{cipher}([0-9a-f]+)", ": '{cipher}$1'");
231232
}
232233

233234
return getSuccess(yaml);

0 commit comments

Comments
 (0)