Skip to content

Commit

Permalink
Merge branch '3.0.x'
Browse files Browse the repository at this point in the history
Closes gh-35367
  • Loading branch information
mhalbritter committed May 9, 2023
2 parents 87d8340 + 077f61b commit 0f1870e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ protected Yaml createYaml() {
loaderOptions.setAllowDuplicateKeys(false);
loaderOptions.setMaxAliasesForCollections(Integer.MAX_VALUE);
loaderOptions.setAllowRecursiveKeys(true);
loaderOptions.setCodePointLimit(Integer.MAX_VALUE);
return createYaml(loaderOptions);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,18 @@ void loadWhenUsingAnchors() {
assertThat(loaded.get("some.anotherpath.config.key")).hasToString("value");
}

@Test
void canLoadFilesBiggerThan3Mb() {
StringBuilder yaml = new StringBuilder();
while (yaml.length() < 4_194_304) {
yaml.append("- some list entry\n");
}
Resource resource = new ByteArrayResource(yaml.toString().getBytes(StandardCharsets.UTF_8));
this.loader = new OriginTrackedYamlLoader(resource);
Map<String, Object> loaded = this.loader.load().get(0);
assertThat(loaded).isNotEmpty();
}

private OriginTrackedValue getValue(String name) {
if (this.result == null) {
this.result = this.loader.load();
Expand Down

0 comments on commit 0f1870e

Please sign in to comment.