[jdk17u] Integrated: 8283544: HttpClient GET method adds Content-Length: 0 header

Goetz Lindenmaier goetz at openjdk.org
Wed Dec 10 08:22:41 UTC 2025


On Wed, 3 Dec 2025 11:24:10 GMT, Goetz Lindenmaier <goetz at openjdk.org> wrote:

> I backport this for parity with 17.0.18-oracle.
> 
> Clean backport. Original change is in 19.
> 
> The test does not build as https://bugs.openjdk.org/browse/JDK-8276559 (httpclient) Consider adding an HttpRequest.Builder.HEAD method to build a HEAD request.
> is not in 17.  It was only added in 18.  Subtest headWithNoBody() is the problem.
> 
> I could replace the call to HEAD() by the implementation of that simple method.
> This does not work though. The test uses the  HttpRequestBuilderImpl.  There
> HEAD() is implemented as return method0("HEAD", null);
> But method0 is private, and method() rejects null.
> 
> Using the implementation of the default method in HttpRequest does not work with HttpRequestBuilderImpl.
> In this case the test returns a Http error 400.
> 
> Thus I just omit the test. See second commit.

This pull request has now been integrated.

Changeset: 3c17462c
Author:    Goetz Lindenmaier <goetz at openjdk.org>
URL:       https://git.openjdk.org/jdk17u/commit/3c17462cb874247d89da1514e9dae32046eef695
Stats:     250 lines in 2 files changed: 236 ins; 6 del; 8 mod

8283544: HttpClient GET method adds Content-Length: 0 header

Reviewed-by: mbaesken
Backport-of: 6a7709320d28d8e1593b113fdf39ab583fca3687

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

PR: https://git.openjdk.org/jdk17u/pull/413


More information about the jdk-updates-dev mailing list