diff --git a/fetch.bs b/fetch.bs index a1d323376..8ff5cfd65 100644 --- a/fetch.bs +++ b/fetch.bs @@ -770,6 +770,9 @@ production as
Let value be header's value. +
If value's length is greater than 128, then return + false. +
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. +
Return false. -
If value's length is greater than 128, then return - false. -
Return true.
Return values. +
To determine if a byte sequence value is a +simple range header value, perform the following steps. They return a boolean. + +
Let data be the isomorphic decoding of value. + +
If data does not start with "bytes=
", then return
+ false.
+
+
Let position be a position variable for data, initially + pointing at the 6th code point of data. + +
Let rangeStart be the result of collecting a sequence of code points that + are ASCII digits, from data given position. + +
If the code point at position within data is not U+002D (-), + then return false. + +
Advance position by 1. + +
Let rangeEnd be the result of collecting a sequence of code points that + are ASCII digits, from data given position. + +
If position is not past the end of data, then return false. + +
If rangeEnd's length is 0, then return true. + +
The range end can be omitted, e.g., `bytes 0-
` is valid.
+
+
If rangeStart, interpreted as decimal number, is greater than + rangeEnd, interpreted as decimal number, then return false. + +
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 ` Let rangeValue be ` Assert: last is not given, or first is less than or equal to
+ last.
+
+ Let rangeValue be ` Serialize and isomorphic encode first,
and append the result to rangeValue.
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:
-
bytes
`.
+ bytes=
`.