On Wed, 4 Nov 2020 20:44:10 GMT, Patrick Concannon <[email protected]>
wrote:
>> Hi,
>>
>> Could someone please review my fix for JDK-8253005: 'Add `@throws
>> IOException` in javadoc for `HttpEchange.sendResponseHeaders`' ?
>>
>> The method `HttpEchange.sendResponseHeaders` throws an `IOException` but is
>> unspecified in its javadoc. This fix adds an `@throws IOException` to its
>> specification and a description of the conditions under which the exception
>> is thrown.
>>
>> Kind regards,
>> Patrick
>
> Patrick Concannon has updated the pull request with a new target base due to
> a merge or a rebase. The incremental webrev excludes the unrelated changes
> brought in by the merge/rebase. The pull request contains eight additional
> commits since the last revision:
>
> - 8253005: Added test to verify `IOException` thrown when headers already
> sent
> - Merge remote-tracking branch 'origin/master' into JDK-8253005
> - Merge remote-tracking branch 'origin/master' into JDK-8253005
> - Merge remote-tracking branch 'origin/master' into JDK-8253005
> - Merge remote-tracking branch 'origin/master' into JDK-8253005
> - Merge remote-tracking branch 'origin/master' into JDK-8253005
> - Merge remote-tracking branch 'origin/master' into JDK-8253005
> - 8253005: Add `@throws IOException` in javadoc for
> `HttpEchange.sendResponseHeaders`
Changes requested by dfuchs (Reviewer).
test/jdk/java/net/httpclient/SendResponseHeadersTest.java line 86:
> 84: static class TestHandler implements HttpHandler {
> 85: public void handle(HttpExchange exchange) throws IOException {
> 86: exchange.sendResponseHeaders(200, 0);
It's always preferable to read the request body fully before calling
`sendResponseHeaders`
-------------
PR: https://git.openjdk.java.net/jdk/pull/1014