RFR: 8358942: HttpClient adds Content-Length: 0 for a GET request with a BodyPublishers.noBody() [v5]

Daniel Fuchs dfuchs at openjdk.org
Wed Oct 15 10:10:23 UTC 2025


On Tue, 14 Oct 2025 18:37:35 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>> Do not send the Content-Length header on HTTP/1.1 requests when the content length is known to be zero and the method does not expect content or is unknown.
>> 
>> This brings the HTTP/1.1 implementation in line with the recommendations from RFC 9110.
>> 
>> The existing ContentLengthHeaderTest was extended to cover the modified scenarios.
>> 
>> Tier1-3 tests continue to pass.
>
> Daniel Jeliński has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove leftover check

@djelinski you should probably Finalize the CSR [JDK-8369533](https://bugs.openjdk.org/browse/JDK-8369533) now.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27727#issuecomment-3405616198


More information about the net-dev mailing list