diff --git a/fetch.bs b/fetch.bs
index aac85636d..b93223a09 100755
--- a/fetch.bs
+++ b/fetch.bs
@@ -618,6 +618,35 @@ are always combined when exposed to client-side JavaScript, implementations coul
efficient representation, as long as they also support an associated data structure for
`Set-Cookie` headers.
+
A header list has an associated +hidden range value +(null or a header value). It is initially null. + +
This is for cases where a "no-cors" request needs to include a
+ `Range` header, but it can not be exposed via {{Headers}}. It can be set by privileged
+ APIs, and will be preserved if its associated request object is copied, but will be removed if the
+ request is modified by unprivileged APIs.
+
+
`Range` headers are commonly used by downloads
+ and media fetches.
+
+
A helper is provided to add a range header to a particular request. +
To get the range value +from a header list list, run these steps. They return null or a +header value. + +
If list contains `Range`, then return the
+ result of getting `Range` from list.
+
+
Return list's hidden range value. +
To get a structured field value @@ -881,6 +910,22 @@ directly. Use get, decode, and split instead. byte-case-insensitive match for name from list.
To empty a +header list list: + +
Empty list. + +
Set list's hidden range value to null. +
A header list list +is empty +if list is empty and list's +hidden range value is null. +
To set a header (name, value) in a header list list: @@ -1140,23 +1185,6 @@ following is true:
A CORS non-wildcard request-header name is a header name that is a
byte-case-insensitive match for `Authorization`.
-
A privileged no-CORS request-header name is a header name that is -a byte-case-insensitive match for one of - -
Range`.
-These are headers that can be set by privileged APIs, and will be preserved if their associated - request object is copied, but will be removed if the request is modified by unprivileged APIs. - -
`Range` headers are commonly used by downloads
- and media fetches.
-
-
A helper is provided to add a range header to a particular request. -
A CORS-safelisted response-header name, given a list of
header names list, is a header name that is a
byte-case-insensitive match for one of
@@ -2446,8 +2474,8 @@ is to return the result of serializing a request origin with request
If last is given, then serialize and
isomorphic encode it, and append the result to rangeValue.
- Append (` Set request's header list's
+ hidden range value to rangeValue.
A range header denotes an inclusive byte range. There a range header where
@@ -4710,7 +4738,7 @@ the response. [[!HTTP-CACHING]]
request's method is ` request's unsafe-request flag is not set or
- request's header list is empty
+ request's header list is empty
then:
@@ -5126,10 +5154,10 @@ steps:
If response's type is " Traditionally, APIs accept a ranged response even if a range was not requested. This prevents
@@ -5556,9 +5584,13 @@ returning a response directly, or allowing the request to proceed by returning n
Let type be blob's {{Blob/type}}.
+ Let rangeHeader be the result of getting the range
+ value from request's header list.
+
+
If request's header list
- does not contain ` If rangeHeader is null:
Let bodyWithType be the result of safely extracting
@@ -5580,11 +5612,6 @@ returning a response directly, or allowing the request to proceed by returning n
Set response's range-requested flag.
- Let rangeHeader be the result of getting
- ` Let rangeValue be the result of parsing a single range header value
given rangeHeader and true.
@@ -6251,6 +6278,12 @@ run these steps:
If httpRequest's header list's
+ hidden range value is non-null, then append
+ (` If httpRequest's header list contains
` To
remove privileged no-CORS request-headers
-from a {{Headers}} object (headers), run these steps:
-
- For each headerName of
- privileged no-CORS request-header names:
-
- Delete headerName from headers's
- header list.
- This is called when headers are modified by unprivileged code.
Passing a dummy header value ought not to have any negative repercussions.
If this's guard is " If this's header list does not contain
name, then return.
@@ -9076,7 +9099,8 @@ constructor steps are:
If init["{{RequestInit/headers}}"] exists, then set
headers to init["{{RequestInit/headers}}"].
- Empty this's headers's header list.
+ Empty this's headers's
+ header list.
If headers is a {{Headers}} object, then for each
header of its header list, append
Range`, rangeValue) to
- request's header list.
+ GET`
opaque",
internalResponse's status is a range status,
- internalResponse's range-requested flag is set, and
- request's header list does not contain
- `Range`, then set response and internalResponse to a
- network error.
+ internalResponse's range-requested flag is set, and the result of
+ getting the range value from request's
+ header list is null, then set response and
+ internalResponse to a network error.
Range`:
+
+ Range` from request's header list.
-
-
Range`, httpRequest's header list's
+ hidden range value) to httpRequest's
+ header list.
+
Range`, then append (`Accept-Encoding`,
@@ -7989,17 +8022,8 @@ value (for {{Headers/delete()}}) that always succeeds in CORS-safelisted requ
-
+from a {{Headers}} object (headers), set headers's
+header list's hidden range value to null.
-
-request-no-cors", name
- is not a no-CORS-safelisted request-header name, and name is not a
- privileged no-CORS request-header name, then return.
+ is not a no-CORS-safelisted request-header name, then return.