-
Notifications
You must be signed in to change notification settings - Fork 38.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PartEvent
API should support limiting the number of file parts
#31343
Comments
We can introduce the Because the |
PartEvent
API should support limiting the number and maximum size of file partsPartEvent
API should support limiting the number of file parts
I have a business requirement that files should be less than 5MB in size and I was using |
I'll see if I can add a |
@poutsma Shouldn't this line Line 194 in 66aac7e
take into account that maxPartSize is -1 by default? Otherwise, not setting the new maxPartSize property will effectively disable the existing maxInMemorySize of 256k...
Maybe a better approach would be to rename the properties to something like What do you think? Context: I'm currently preparing a PR to add auto-configuration for these new properties to Spring Boot and am having trouble coming up with a concise description of what these are actually controlling. |
Good point, I will fix that.
Renaming the properties would break backward compatibility, so that's not really an option at this point. Moreover, this change would ignore the fact that |
With the "old" WebFlux multipart functionality, we could limit the number of parts with
org.springframework.http.codec.multipart.DefaultPartHttpMessageReader#maxParts
, and the maximum part size with a combination oforg.springframework.http.codec.multipart.DefaultPartHttpMessageReader#maxInMemorySize
andorg.springframework.http.codec.multipart.DefaultPartHttpMessageReader#maxDiskUsagePerPart
.But
org.springframework.http.codec.multipart.PartEventHttpMessageReader
does not offer such a configuration. It does havemaxInMemorySize
, but that can only be used to limit the size of form parts and has no effect on file parts.Is there a particular reason for not offering that configuration? Is there another recommended way of implementing these limits myself when using
PartEvent
?The text was updated successfully, but these errors were encountered: