RFR: 8170305: URLConnection doesn't handle HTTP/1.1 1xx (informational) messages [v2]

Jaikiran Pai jpai at openjdk.org
Mon Sep 12 07:40:04 UTC 2022


On Mon, 12 Sep 2022 07:36:48 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Can I please get a review of this change which proposes to fix https://bugs.openjdk.org/browse/JDK-8170305?
>> 
>> The commit in this PR changes the internal implementation of `HttpURLConnection` to ignore interim informational 1xx responses from server and continue to wait for the final response. This is a similar fix to what we did in the new `HttpClient` API in https://github.com/openjdk/jdk/pull/10169.
>> 
>> A new test has been added to use the `HttpURLConnection` to reproduce the issue and verify the fix.
>> 
>> tier1, tier2 and tier3 testing is in progress with this change.
>
> Jaikiran Pai has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - consider it a protocol violation if the server sends a 101 when the HttpURLConnection doesn't ask for a connection upgrade
>  - 101 Upgrade isn't supported by HttpURLConnection, so ignore that response too

Hello Daniel,
I've now updated the PR to include a test for 101 as well as updated the source to handle the 101 differently than other interim 1xx responses. Since `HttpURLConnection` doesn't support connection upgrade, the receipt of a 101 response from a server is considered an error and with the change in this PR, the request will now fail and we internally close the connection as well.

I've triggered tier1, tier2 and tier3 to make sure this doesn't cause any issues.

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

PR: https://git.openjdk.org/jdk/pull/10229


More information about the net-dev mailing list