RFR: 8355572: Support HTTP Range requests in Simple Web Server [v8]

Peyang duke at openjdk.org
Mon Nov 3 11:54:06 UTC 2025


On Sun, 2 Nov 2025 17:04:22 GMT, Florent Guillaume <duke at openjdk.org> wrote:

>> Peyang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Allow unlimited splits when parsing HTTP Range header to detect trailing commas
>
> test/jdk/com/sun/net/httpserver/simpleserver/FileServerHandlerTest.java line 147:
> 
>> 145: 
>> 146:                 // malformed numbers or format
>> 147:                 {"bytes=-0"}, {"bytes=meow"}, {"bytes=--500"}, {"bytes=500"}, {"bytes=-"}, {"bytes=+500-600"},
> 
> Please add a test for `bytes=400--500` which uses a code path not covered by existing tests.
> Also worth adding `bytes=500-+600` and variations with `+` in all possible positions, and omitting left part.
> Add also `bytes=--`, `bytes=-+1`, ... I'm sure one could come up with more.

Thanks for your review.
I've added some of the suggested invalid range patterns to the test.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28021#discussion_r2486212083


More information about the net-dev mailing list