RFR: 8328919: Add BodyHandlers / BodySubscribers methods to handle excessive server input [v10]

Jaikiran Pai jpai at openjdk.org
Tue Jan 21 14:45:45 UTC 2025


On Tue, 21 Jan 2025 10:58:57 GMT, Volkan Yazıcı <duke at openjdk.org> wrote:

>> Adds `limiting()` factory methods to `HttpResponse.Body{Handlers,Subscribers}` to handle excessive server input in `HttpClient`. I would appreciate your input whether `discardExcess` should be kept or dropped. I plan to file a CSR once there is an agreement on the PR.
>
> Volkan Yazıcı has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Fix `assertThrows` in `HttpResponseLimitingTest`
>  - Fix `HttpResponseLimitingTest` license header

test/jdk/java/net/httpclient/HttpResponseLimitingTest.java line 70:

> 68: import static org.junit.jupiter.api.Assertions.assertThrows;
> 69: 
> 70: class HttpResponseLimitingTest {

I think we should also add test methods to verify that the newly added methods throw a `NullPointerException` and `IllegalArgumentException` for incorrect parameters.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23096#discussion_r1923856280


More information about the net-dev mailing list