RFR: 8286171: HttpClient/2 : Expect:100-Continue blocks indefinitely when response is not 100 [v3]
Jaikiran Pai
jpai at openjdk.java.net
Thu Jun 9 12:09:33 UTC 2022
On Thu, 9 Jun 2022 11:51:13 GMT, Conor Cleary <ccleary at openjdk.org> wrote:
>> test/jdk/java/net/httpclient/ExpectContinueTest.java line 264:
>>
>>> 262:
>>> 263: HttpRequest getRequest = HttpRequest.newBuilder(getUri)
>>> 264: .GET()
>>
>> Is this missing an `.expectContinue(true)` here?
>
> Its not needed for a GET request as the client is not sending a body in that case. In this test the GET serves only to complete the HTTP/2 upgrade before testing with a POST request.
>From what I understand, the HTTP version in the client request comes in as an input to the test method and we pass `HTTP/1.1` as one such version. In that case there won't be a HTTP/2 upgrade involved since the request (via the client) will be pinned to HTTP/1.1 version. The test will still pass, but it won't be testing any `Expect: 100-continue` with `GET` requests. Of course GET requests aren't expected to have a request body, so testing this header with that method may not be meaningful after all (although the client implementation doesn't enforce that restriction).
-------------
PR: https://git.openjdk.java.net/jdk/pull/9093
More information about the net-dev
mailing list