-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing "Content-Length: 0" header with HttpComponents
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
- Loading branch information
Showing
3 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters