mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
47c5cd208c
Prior to this commit, HTTP requests sent with the `HttpComponentsClientHttpRequestFactory` would not set a "Content-Length" header for empty request bodies. Setting a request entity is the expected behavior for unsafe HTTP methods, and this would align the behavior with other HTTP clients. Developers would often rely on `BufferingClientHttpRequestFactory` to set this information on the request. This commit ensures that a `NullEntity` is used for unsafe HTTP methods, when no body has been set for the request. This result in a "Content-Length:0" request header. Fixes gh-32678