You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PartEventHttpMessageReader#maxParts, configured via spring.webflux.multipart.max-parts, is validated incorrectly. Sending a multipart request with as many parts as should be allowed by that property is rejected with Too many parts.
This means that if I want to allow at most 5 parts, I'll have to set spring.webflux.multipart.max-parts=6.
This test creates as many file parts as configured via spring.webflux.multipart.max-parts and sends them to the controller method above, expecting success. The request is however rejected and the following exception is thrown: org.springframework.core.codec.DecodingException: Too many parts (6/5 allowed)
I can reproduce the behavior with the demo. From what I can see the calculation in PartEventHttpMessageReader is correct, but there is one extra emission from concatMap here in the beginning.
The Javadoc for windowUntil says "This variant can emit an empty window if the sequence starts with a separator" and since the sequence starts with a headers token, I think that is the reason for the extra emission.
Maybe the counting should be moved a few lines down to here inside the switchOnFirst where we know we are handling the headers for the next part?
Boot: 3.2.2
Framework: 6.1.3
PartEventHttpMessageReader#maxParts
, configured viaspring.webflux.multipart.max-parts
, is validated incorrectly. Sending a multipart request with as many parts as should be allowed by that property is rejected withToo many parts
.This means that if I want to allow at most 5 parts, I'll have to set
spring.webflux.multipart.max-parts=6
.Controller:
This test creates as many file parts as configured via
spring.webflux.multipart.max-parts
and sends them to the controller method above, expecting success. The request is however rejected and the following exception is thrown:org.springframework.core.codec.DecodingException: Too many parts (6/5 allowed)
Reproducer (extract and run
./mvnw test
): demo.zipThe text was updated successfully, but these errors were encountered: