RFR: 8355572: Support HTTP Range requests in Simple Web Server [v2]
Peyang
duke at openjdk.org
Wed Oct 29 10:57:32 UTC 2025
On Tue, 28 Oct 2025 18:36:01 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java line 279:
>>
>>> 277: respHdrs.set("Last-Modified", getLastModified(path));
>>> 278: respHdrs.set("Accept-Ranges", "bytes");
>>> 279: respHdrs.set("ETag", createETag(path));
>>
>> ETag is an entirely separate feature from Range and should be in its own separate followup Jira ticket and PR.
>
> In addition should the Etag be considered weak as there is no way to guarantee that the file won't be modified between the time the attributes are read and the time the file content is read?
Thank you for your reviews.
I initially added `ETag` header for `If-Range` because I misunderstood it was a requirement, but it is actually not mandatory. So I will remove it from this patch.
If a follow-up ticket could be created, since I don’t have permissions, I’d be happy to take it on.
However, whether supporting ETag here is truly necessary is still open for discussion.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28021#discussion_r2472542909
More information about the net-dev
mailing list