RFR: 8355572: Support HTTP Range requests in Simple Web Server [v6]
Daniel Fuchs
dfuchs at openjdk.org
Mon Nov 3 16:01:44 UTC 2025
On Sat, 1 Nov 2025 10:24:45 GMT, Peyang <duke at openjdk.org> wrote:
>> Yes please. I'd prefer to have built-in validation.
>
> I implemented a check that validates whether the ranges are in ascendnig order and non-overlapping, returning an error if they are not.
> However, I have some concerns: this restriction might be too strict.
>
> Instead of outright rejecting requests with overlapping or unsorted ranges, what if the server simply combines overlapping ranges and sorts them before returning?
> According to [RFC 7233 §15.3.7.2](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.7.2-4):
>> When multiple ranges are requested, a server **MAY** coalesce any of the ranges that overlap, or that are separated by a gap that is smaller than the overhead of sending multiple parts, regardless of the order in which the corresponding range-spec appeared in the received [Range](https://www.rfc-editor.org/rfc/rfc9110.html#field.range) header field.
>
> In other words, rather than strictly validating and rejecting, we could treat this as an efficiency optimization on the server side. I think this approach would be more practical. I’d like to hear your thoughts on this.
That would be fine too.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28021#discussion_r2487001106
More information about the net-dev
mailing list