Merge branch '3.1.x'

Closes gh-38152
This commit is contained in:
Andy Wilkinson 2023-10-31 11:50:42 +00:00
commit 8f2ec22738
2 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ public class ReactiveMultipartAutoConfiguration {
.asInt(DataSize::toBytes)
.to(defaultPartHttpMessageReader::setMaxHeadersSize);
map.from(multipartProperties::getMaxDiskUsagePerPart)
.asInt(DataSize::toBytes)
.as(DataSize::toBytes)
.to(defaultPartHttpMessageReader::setMaxDiskUsagePerPart);
map.from(multipartProperties::getMaxParts).to(defaultPartHttpMessageReader::setMaxParts);
map.from(multipartProperties::getFileStorageDirectory)

View File

@ -62,7 +62,7 @@ class ReactiveMultipartAutoConfigurationTests {
this.contextRunner
.withPropertyValues("spring.webflux.multipart.max-in-memory-size=1GB",
"spring.webflux.multipart.max-headers-size=16KB",
"spring.webflux.multipart.max-disk-usage-per-part=100MB", "spring.webflux.multipart.max-parts=7",
"spring.webflux.multipart.max-disk-usage-per-part=3GB", "spring.webflux.multipart.max-parts=7",
"spring.webflux.multipart.headers-charset:UTF_16")
.run((context) -> {
CodecCustomizer customizer = context.getBean(CodecCustomizer.class);
@ -76,7 +76,7 @@ class ReactiveMultipartAutoConfigurationTests {
assertThat(partReader).hasFieldOrPropertyWithValue("maxInMemorySize",
Math.toIntExact(DataSize.ofGigabytes(1).toBytes()));
assertThat(partReader).hasFieldOrPropertyWithValue("maxDiskUsagePerPart",
DataSize.ofMegabytes(100).toBytes());
DataSize.ofGigabytes(3).toBytes());
});
}