mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-26 17:09:05 +00:00
The new PartGenerator for parsing multipart requests supports buffering the content in memory and switching to a file after a configured size. More specifically, when a multipart part exceeds maxInMemorySize and InMemoryState switches it over to FileState, the bytes that were already buffered in memory are flushed to the temp file. Prior to this commit, this was done via FileState.writeBuffer(), meaning that the in memory buffered data would not be counted against the configured limit for writing to a file. This commit fixes this by writing buffered data with FileState.onBody(). Fixes gh-37238