diff --git a/fetch.bs b/fetch.bs index cfaaf6693..dd8aeb4c1 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1675,7 +1675,7 @@ Unless stated otherwise, it is unset.
only-if-cached
"
same-origin
". Any cached redirects will be followed assuming
request's
@@ -2018,6 +2018,14 @@ known as an aborted network error
header list is always empty, and
body is always null.
+To create a network error given
+fetch params fetchParams, return a new network error with its
+timing info set to the result of creating an opaque timing info with
+fetchParams's timing info, and its
+URL list set to a list containing fetchParams's
+request's URL.
+
+
A filtered response is a limited view on a
@@ -3790,8 +3798,9 @@ steps:
Let response be null.
If request's local-URLs-only flag is set and request's
- current URL is not local, then set response to a
- network error.
+ current URL is not local, then set response to
+ the result of creating a network error given
+ fetchParams.
Run report Content Security Policy violations for request.
@@ -3800,7 +3809,8 @@ steps:
If should request be blocked due to a bad port,
should fetching request be blocked as mixed content, or
should request be blocked by Content Security Policy
- returns blocked, then set response to a network error.
+ returns blocked, then set response to the result of
+ creating a network error given fetchParams..
If request's referrer policy is the empty string, then set
request's referrer policy to request's
@@ -3864,14 +3874,16 @@ steps:
Return a network error.
+ Return the result of creating a network error given
+ fetchParams.
If request's redirect mode is not " Set request's
response tainting to
@@ -3896,7 +3908,8 @@ steps:
Return a network error.
+ Return the result of creating a network error given
+ fetchParams.
should internalResponse to request be blocked due to nosniff
- then set response and internalResponse to a network error.
+ then set response and internalResponse to the result of creating a network error given
+ fetchParams.
If response's type is " Traditionally, APIs accept a ranged response even if a range was not requested. This prevents
@@ -4173,7 +4188,8 @@ steps:
name is ` Otherwise, return a network error.
+ Otherwise, return the result of creating a network error
+ given fetchParams.
URLs such as " If request's method is not ` The ` Let aborted be the termination's aborted flag.
- If aborted is set, then return an aborted network error.
+ If aborted is set, then return the result of
+ creating an aborted network error given
+ fetchParams.
- Return a network error.
+ Return the result of creating a network error given
+ fetchParams.
Let dataURLStruct be the result of running the
If dataURLStruct is failure, then return a network error.
+ If dataURLStruct is failure, then return the result of
+ creating a network error given fetchParams..
Return a response whose status message is
` For now, unfortunate as it is, When in doubt, return a network error.
+ When in doubt, return the result of creating a network error given
+ fetchParams.
Return the result of running HTTP fetch given fetchParams.
Return a network error.
+ Return the result of creating a network error given
+ fetchParams.
@@ -4361,7 +4385,8 @@ these steps:
response's URL list has more than one item.
- then return a network error.
+ then return the result of creating a network error given
+ fetchParams.
@@ -4500,13 +4525,16 @@ run these steps:
If locationURL is null, then return response.
- If locationURL is failure, then return a network error.
+ If locationURL is failure, then return the result of
+ creating a network error given fetchParams.
If locationURL's scheme is not an HTTP(S) scheme, then
- return a network error.
+ return the result of creating a network error given
+ fetchParams.
If request's redirect count is
- twenty, return a network error.
+ twenty, return the result of creating a network error given
+ fetchParams.
Increase request's
redirect count by one.
@@ -4514,17 +4542,20 @@ run these steps:
If request's mode is " If request's response tainting is " This catches a cross-origin resource redirecting to a same-origin URL.
If actualResponse's status is not 303, request's
body is non-null, and request's body's
- source is null, then return a network error.
+ source is null, then return the result of
+ creating a network error given fetchParams.
If locationURL's origin is not same origin with
request's current URL's origin and
@@ -4718,7 +4749,8 @@ steps. They return a response.
If the sum of contentLength and inflightKeepaliveBytes is greater
- than 64 kibibytes, then return a network error.
+ than 64 kibibytes, then return the result of creating a
+ network error given fetchParams.
The above limit ensures that requests that are allowed to outlive the
@@ -4964,9 +4996,12 @@ steps. They return a response.
Let aborted be the termination's aborted flag.
- If aborted is set, then return an aborted network error.
+ If aborted is set, then return the result of
+ creating an aborted network error given
+ fetchParams.
- Return a network error.
+ Return the result of creating a network error given
+ fetchParams.
If httpRequest's cache mode is
- " Let forwardResponse be the result of running HTTP-network fetch given
httpFetchParams, includeCredentials, and isNewConnectionFetch.
@@ -5048,7 +5084,8 @@ steps. They return a response.
If request's body's source is null,
- then return a network error.
+ then return the result of creating a network error given
+ fetchParams.
Set request's body to the first return value of
safely extracting request's body's
@@ -5066,9 +5103,12 @@ steps. They return a response.
Let aborted be the termination's aborted flag.
- If aborted is set, then return an aborted network error.
+ If aborted is set, then return the result of
+ creating an aborted network error given
+ fetchParams.
- Return a network error.
+ Return the result of creating a network error given
+ fetchParams.
Let username and password be the result of prompting the end user
@@ -5091,7 +5131,8 @@ steps. They return a response.
If request's window is
- " Needs testing: multiple ` Let aborted be the termination's aborted flag.
- If aborted is set, then return an aborted network error.
+ If aborted is set, then return the result of
+ creating an aborted network error given
+ fetchParams.
- Return a network error.
+ Return the result of creating a network error given
+ fetchParams.
Let aborted be the termination's aborted flag.
- If aborted is set, then return an aborted network error.
+ If aborted is set, then return the result of
+ creating an aborted network error given
+ fetchParams.
- Return a network error.
+ Return the result of creating a network error given
+ fetchParams.
Set response to the result of running HTTP-network-or-cache fetch given
@@ -5203,7 +5250,8 @@ optional boolean forceNewConnection (default false), run these steps:
Run these steps, but abort when the ongoing fetch is terminated:
If connection is failure, then return a network error.
+ If connection is failure, then return the result of
+ creating a network error given fetchParams.
Set timingInfo's final connection timing info to
the result of calling clamp and coarsen connection timing info with
@@ -5234,7 +5282,8 @@ optional boolean forceNewConnection (default false), run these steps:
buffer of up to 64 kibibytes and store a part of request's body
in that buffer. If the user agent reads from request's body
beyond that buffer's size and the user agent needs to resend request, then instead
- return a network error.
+ return the result of creating a network error given
+ fetchParams.
The resending is needed when the connection is timed out, for example.
@@ -5272,7 +5321,8 @@ optional boolean forceNewConnection (default false), run these steps:
If request's header list contains
` If the HTTP request results in a TLS client certificate dialog, then:
@@ -5282,7 +5332,8 @@ optional boolean forceNewConnection (default false), run these steps:
available in request's
window.
- Otherwise, return a network error.
+ Otherwise, return the result of creating a
+ network error given fetchParams.
To transmit request's body body, run these steps:
@@ -5352,9 +5403,12 @@ optional boolean forceNewConnection (default false), run these steps:
If connection uses HTTP/2, then transmit an If aborted is set, then return an aborted network error.
+ If aborted is set, then return the result of
+ creating an aborted network error given
+ fetchParams.
- Return a network error.
+ Return the result of creating a network error given
+ fetchParams.
Let pullAlgorithm be an action that resumes the
@@ -5588,7 +5642,8 @@ number of these fetches.
header list.
If either methods or headerNames is failure,
- return a network error.
+ return the result of creating a network error given
+ fetchParams.
If methods is null and request's use-CORS-preflight flag
@@ -5602,19 +5657,22 @@ number of these fetches.
If request's method is not in methods,
request's method is not a CORS-safelisted method, and
request's credentials mode is " If one of request's header list's
names is a CORS non-wildcard request-header name and is not a
byte-case-insensitive match for an item in headerNames, then
- return a network error.
+ return the result of creating a network error given
+ fetchParams.
For each unsafeName in the
CORS-unsafe request-header names with request's
header list, if unsafeName is not a byte-case-insensitive
match for an item in headerNames and request's
credentials mode is " Let max-age be the result of extracting header list values given
` Return response.
- Otherwise, return a network error.
+ Otherwise, return the result of creating a network error
+ given fetchParams.
@@ -7270,7 +7329,8 @@ constructor steps are:
The static The static
@@ -7422,8 +7482,14 @@ method steps are:
with p, request, and responseObject, and terminate these
substeps.
- If response is a network error, then reject p
- with a {{TypeError}} and terminate these substeps.
+ If response is a network error, then:
+ Reject p with a {{TypeError}}.
+
+ Call handleFetchDone terminate these substeps.
+ Set responseObject to the result of creating a {{Response}}
object, given response, "
same-origin
"
- no-cors
"
follow
",
- then return a network error.
+ then return the result of creating a network error given
+ fetchParams.
opaque
",
internalResponse's status is 206, 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.
+ then set response and internalResponse to the result of
+ creating a network error given fetchParams.
Content-Type
` and value is
`text/html;charset=utf-8
`, and body is the empty byte sequence.
- about:config
" are handled
during navigation and result in a network error in the context of
@@ -4191,7 +4207,9 @@ steps:
GET
` or
- blob is not a {{Blob}} object, then return a network error. [[!FILEAPI]]
+ blob is not a {{Blob}} object, then return the result of
+ creating a network error given fetchParams.
+ [[!FILEAPI]]
GET
` method restriction serves no useful purpose
other than being interoperable.
@@ -4226,9 +4244,12 @@ steps:
@@ -4238,7 +4259,8 @@ steps:
data:
URL processor on request's current URL.
- OK
`, header list consist of a single header whose
@@ -4253,14 +4275,16 @@ steps:
file
URLs are left as an exercise for
the reader.
- cors
",
locationURL includes credentials, and request's
origin is not same origin with locationURL's
- origin, then return a network error.
+ origin, then the result of creating a
+ network error given fetchParams.
cors
" and
- locationURL includes credentials, then return a network error.
+ locationURL includes credentials, then return the result of
+ creating a network error given fetchParams.
@@ -4975,7 +5010,8 @@ steps. They return a response.
only-if-cached
", then return a network error.
+ "only-if-cached
", then return the result of creating a
+ network error given fetchParams.
no-window
", then return a network error.
+ "no-window
", then return the result of creating a
+ network error given fetchParams.
Proxy-Authenticate
` headers, missing,
parsing issues.
@@ -5102,9 +5143,12 @@ steps. They return a response.
-
Transfer-Encoding
`/`chunked
` and response is transferred
- via HTTP/1.0 or older, then return a network error.
+ via HTTP/1.0 or older, then return the result of creating a
+ network error given fetchParams.
RST_STREAM
frame.
- include
" or
- methods does not contain `*
`, then return a network error.
+ methods does not contain `*
`, then return the result of
+ creating a network error given fetchParams.
include
" or headerNames does not
- contain `*
`, return a network error.
+ contain `*
`, return the result of creating a
+ network error given fetchParams.
Access-Control-Max-Age
` and response's
@@ -5647,7 +5705,8 @@ number of these fetches.
error()
method steps are to return the
-result of creating a {{Response}} object, given a new network error,
+result of creating a {{Response}} object, given the result of
+creating an network error given fetchParams,
"immutable
", and this's relevant Realm.
+
immutable
", and relevantRealm.