After upgrading Spring Boot from version 3.3.5 to 3.4.3, we started receiving an HTTP 411 error from an external service when performing a POST request via WebClient and HTTP/1.1.

To identify the exact version introducing the issue, we compared the behavior across different Spring Boot versions and observed: • In 3.3.5: A Transfer-Encoding: chunked header is sent. • In 3.4.0: Also Transfer-Encoding: chunked. • Starting with 3.4.1: Instead of Transfer-Encoding, a Content-Length: 0 header is sent (this is also true for 3.4.2). • In 3.4.3: Neither Transfer-Encoding nor Content-Length is present.

It appears that the external service rejects the request if neither header is included.

To illustrate this, I created a sample application that closely mirrors our configuration and call, and which logs the sent headers. When running on Spring Boot 3.4.3, the logs show that neither header is sent; however, reverting to an earlier version brings back one of these headers, and the request works in our application as expected.

demo.zip

Comment From: bclozel

I think this can be tracked to reactor-netty itself. There have been changes in this area.