Sometimes multipart/form-data requests containing a file with size of less than a megabyte hang, they do not reach controller's method. I have a sample project that reproduces the issue on Spring Boot 2.7.2. The test the project sends requests with WebTestClient. Using the java.net.http client gives the same result.

Comment From: frost13it

Also I have a workaround: adding an empty part after the file seems to prevent requests from hanging.

Comment From: poutsma

Thanks for providing a sample, that made this a lot easier to fix!