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

Volkan Yazici vyazici at openjdk.org
Wed Oct 15 08:16:14 UTC 2025


On Tue, 14 Oct 2025 17:55:23 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>> If I'm not mistaken in case of H2/H3 you could verify that:
>> 
>> 
>> assertTrue(List.of("Request completed, no content length", "Request completed").contains(resp.body()), "Unexpected response: " + resp.body());
>
> I ended up removing the `OptionalContentLengthHandler`. It didn't feel right anyway.

`OptionalContentLengthHandler` gone feels better. This also implies that the check is stricter: we either expect the `Content-Length`, or not.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27727#discussion_r2431557038


More information about the net-dev mailing list