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

Daniel Fuchs dfuchs at openjdk.java.net
Tue Apr 19 16:49:16 UTC 2022


On Tue, 19 Apr 2022 16:43:12 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Conor Cleary has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8283544: Updated URI creation
>
> test/jdk/java/net/httpclient/ContentLengthHeaderTest.java line 202:
> 
>> 200:             } else {
>> 201:                 String responseBody = exchange.getRequestMethod() + " request contained an unexpected " +
>> 202:                         "Content-length header.";
> 
> Maybe the message could include the value of `Content-Length` that was received.

Also it's always better to drain the request input stream even if there is no bytes.

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

PR: https://git.openjdk.java.net/jdk/pull/8017


More information about the net-dev mailing list