diff --git a/fetch.bs b/fetch.bs index a1d323376..8ff5cfd65 100644 --- a/fetch.bs +++ b/fetch.bs @@ -770,6 +770,9 @@ production as
  1. Let value be header's value. +

  2. If value's length is greater than 128, then return + false. +

  3. Byte-lowercase header's name and switch on the result: @@ -822,13 +825,13 @@ fetch("https://victim.example/naïve-endpoint", { +

    `range` +

    If value is not a simple range header value, then return false. +

    Otherwise

    Return false. -

  4. If value's length is greater than 128, then return - false. -

  5. Return true.

@@ -1038,6 +1041,46 @@ run these steps:
  • Return values. +

    To determine if a byte sequence value is a +simple range header value, perform the following steps. They return a boolean. + +

      +
    1. Let data be the isomorphic decoding of value. + +

    2. If data does not start with "bytes=", then return + false. + +

    3. Let position be a position variable for data, initially + pointing at the 6th code point of data. + +

    4. Let rangeStart be the result of collecting a sequence of code points that + are ASCII digits, from data given position. + +

    5. If the code point at position within data is not U+002D (-), + then return false. + +

    6. Advance position by 1. + +

    7. Let rangeEnd be the result of collecting a sequence of code points that + are ASCII digits, from data given position. + +

    8. If position is not past the end of data, then return false. + +

    9. +

      If rangeEnd's length is 0, then return true. + +

      The range end can be omitted, e.g., `bytes 0-` is valid. + +

    10. If rangeStart, interpreted as decimal number, is greater than + rangeEnd, interpreted as decimal number, then return false. + +

    11. Return true. +

    + +

    A simple range header value is a subset of allowed range header values, but +it is the most common form used by user agents when requesting media or resuming downloads. This +format of range header value can be set using add a range header. +


    A default `User-Agent` value is a @@ -1847,7 +1890,10 @@ is to return the result of serializing a request origin with request last, run these steps:

      -
    1. Let rangeValue be `bytes `. +

    2. Assert: last is not given, or first is less than or equal to + last. + +

    3. Let rangeValue be `bytes=`.

    4. Serialize and isomorphic encode first, and append the result to rangeValue.