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

Volkan Yazici vyazici at openjdk.org
Tue Jan 21 20:04:24 UTC 2025


On Tue, 21 Jan 2025 15:13:40 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Fix `assertThrows` in `HttpResponseLimitingTest`
>>  - Fix `HttpResponseLimitingTest` license header
>
> src/java.net.http/share/classes/java/net/http/HttpResponse.java line 755:
> 
>> 753:         /**
>> 754:          * {@return a {@code BodyHandler} limiting the number of body bytes
>> 755:          * consumed and passed to the given downstream {@code BodyHandler}}
> 
> Would rewording this to:
> 
> 
> {@return a {@code BodyHandler} that limits the number of body bytes
> that are delivered to the given {@code downstreamHandler}}
> 
> be more concise?

Changed in e10771317ef57f80d25be58df77eb5c5b0083b0c.

> src/java.net.http/share/classes/java/net/http/HttpResponse.java line 1384:
> 
>> 1382:         /**
>> 1383:          * {@return a {@code BodySubscriber} limiting the number of body bytes
>> 1384:          * consumed and passed to the given downstream {@code BodySubscriber}}
> 
> Similar suggestion as the one I made for `BodyHandlers.limiting()`:
> 
> 
> {@return a {@code BodySubscriber} that limits the number of body bytes
> that are delivered to the given {@code downstreamSubscriber}}

Changed in e10771317ef57f80d25be58df77eb5c5b0083b0c.

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

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


More information about the net-dev mailing list