I am using Spring boot as a web server, we are using the chunked file upload, so it is not multipart, instead, we just read the request inputstream directly. So change of multipart config (spring.servlet.multipart.max-file-size or max-request-size) will not work in my case.
But we need to limit the upload file size, since we don't want to even read the request if the size is large.
We tried to configure the maxSwallowSize (to 20MB) in tomcat, but it didn't work, I can still upload file more than 600MB.
I checked IdentityInputFilter
in tomcat, the maxSwallowSize is right configued, but it seems tomcat is using some remaining value but not the whole request body to compare with maxSwallowSize.
Can anyone show me how to limit the http request body size?