[whatwg/fetch] Clamp oversized suffix ranges for nonempty blob URLs (PR #1967)

Clamp oversized suffix ranges for nonempty blob URLs

For a 10-byte Blob, `Range: bytes=-12` currently produces a start of −2 and an end of 9. Blob slicing then returns only two bytes with `Content-Range: bytes -2-9/10`.

Clamp an oversized suffix to the nonempty Blob’s size before subtraction, matching RFC 9110 §14.1.2. The result is all ten bytes and `Content-Range: bytes 0-9/10`. Empty-Blob and zero-suffix behavior is unchanged.

Validation: checked 28 size/suffix combinations. Local Bikeshed generation succeeded with an offline data-update warning. A corresponding WPT oversized-suffix test is still needed; no browser interoperability or implementer approval is claimed.

- [ ] At least two implementers are interested (and none opposed).
- [ ] WPT tests are written and available for review.
- [ ] Implementation bugs are filed.
- [ ] An MDN issue is filed.
- [x] This comment includes a clear commit message.

Found while reviewing my translation: https://htmlspecs.com/fetch/


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://whatpr.org/fetch/1967.html" title="Last updated on Nov 10, 2026, 1:52 AM UTC (6a2a9a6)">Preview</a> | <a href="https://whatpr.org/fetch/1967/59afe34...6a2a9a6.html" title="Last updated on Nov 10, 2026, 1:52 AM UTC (6a2a9a6)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/fetch/pull/1967

-- Commit Summary --

  * Clamp oversized suffix ranges for nonempty blob URLs

-- File Changes --

    M fetch.bs (3)

-- Patch Links --

https://github.com/whatwg/fetch/pull/1967.patch
https://github.com/whatwg/fetch/pull/1967.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1967
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1967@github.com>

Received on Tuesday, 10 November 2026 01:53:18 UTC