RFR: 8349670: HttpServer: sending interim responses fails after JDK-7026262 [v8]
robert engels
duke at openjdk.org
Wed Oct 8 18:31:31 UTC 2025
On Tue, 23 Sep 2025 17:43:42 GMT, Josiah Noel <duke at openjdk.org> wrote:
>> Following the guideline of the last comment on [JDK-8349670](https://bugs.openjdk.org/browse/JDK-8349670?focusedId=14794649&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14794649), resolves the issue where sending a 1xx status code would close the input stream, preventing the server from reading the body.
>>
>> - When a 1xx status code is sent by `sendResponseHeaders`, the input/output streams will not be closed prematurely.
>> - sentHeaders will not be set to true when sending 1xx status codes
>
> Josiah Noel has updated the pull request incrementally with one additional commit since the last revision:
>
> Update InputRead100Test.java
Hello. I don't think the test provided is representative of the purpose and usage of 100 Continue. The design of this is to allow the client to avoid sending a large body if the request is going to fail.
So, it sends the headers with 'Expect: 100-continue', and if the server validates and accepts them, it sends the '100 Continue' response, and then the client sends the body. Most http servers will automatically send the '100 Continue' when the 'Expect: 100-continue' is set as soon as the server handler calls getInputStream() - with the expectation that all header validation has occurred at this point.
In summary, the test should send the headers, wait for the 100 Continue, then send the body, then read the response.
If any of the above fails/timeouts the test should fail.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27069#issuecomment-3382738459
More information about the net-dev
mailing list