RFR: 8352502: Response message is null if expect 100 assertion fails with non 100

Daniel Fuchs dfuchs at openjdk.org
Thu Jun 26 11:19:28 UTC 2025


On Thu, 26 Jun 2025 10:48:56 GMT, Darragh Clarke <dclarke at openjdk.org> wrote:

> Currently if a request has set Expect-Continue and receives a non 100 response the `responseMessage` wouldn't be set.
> 
> This PR sets `responseMessage`, it also updates `getResponseMessage` to check if the message has already been set. This should match the way that `responseCode` is currently handled.
> 
> I also added a test to cover some possible responses.

test/jdk/java/net/httpclient/ExpectContinueResponseMessageTest.java line 128:

> 126:                     // ignore
> 127:                 } catch (IOException e) {
> 128:                     throw new RuntimeException(e);

This exception will be swallowed, it will have no effect.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25999#discussion_r2168824980


More information about the net-dev mailing list