mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Previously, PartGenerator only enforced maxDiskUsagePerPart for body buffers that arrived after a part had switched to file storage. The content accumulated in memory that triggered the switch was written to disk without any check against maxDiskUsagePerPart. As a result, a part whose last body buffer caused the in-memory overflow was accepted in full, even when its total size exceeded the configured disk usage limit. This commit checks the accumulated byte count against maxDiskUsagePerPart before switching to file storage, and emits a DataBufferLimitException, consistent with the existing check for subsequent buffers. Closes gh-35099 Signed-off-by: seonghun lee <harrisleesh@gmail.com>