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

Matthias Baesken mbaesken at openjdk.org
Thu Dec 4 16:11:04 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.

Marked as reviewed by mbaesken (Reviewer).

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

PR Review: https://git.openjdk.org/jdk17u/pull/413#pullrequestreview-3540786714


More information about the jdk-updates-dev mailing list