diff options
author | Marcos Casagrande <marcoscvp90@gmail.com> | 2022-10-12 09:23:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-12 09:23:33 +0200 |
commit | d47b17d37df8590e4fc2abc249ee33e3ce612251 (patch) | |
tree | 9734f458b16793bce6f4bb2a8a6a1edd29ebc989 | |
parent | 2c96f64fa7ec7655200de4c6740ceade78a3fad7 (diff) |
fix(ext/fetch): throw TypeError on read failure (#16219)
-rw-r--r-- | ext/fetch/lib.rs | 2 | ||||
-rw-r--r-- | tools/wpt/expectation.json | 24 |
2 files changed, 7 insertions, 19 deletions
diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs index b8f784284..c141c3065 100644 --- a/ext/fetch/lib.rs +++ b/ext/fetch/lib.rs @@ -509,7 +509,7 @@ impl Resource for FetchResponseBodyResource { // safely call `await` on it without creating a race condition. Some(_) => match reader.as_mut().next().await.unwrap() { Ok(chunk) => assert!(chunk.is_empty()), - Err(err) => break Err(AnyError::from(err)), + Err(err) => break Err(type_error(err.to_string())), }, None => break Ok(BufView::empty()), } diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json index 828eb079d..d5560ffb6 100644 --- a/tools/wpt/expectation.json +++ b/tools/wpt/expectation.json @@ -2921,7 +2921,9 @@ "accept-header.any.worker.html": true, "conditional-get.any.html": false, "conditional-get.any.worker.html": false, - "error-after-response.any.html": false, + "error-after-response.any.html": { + "ignore": true + }, "header-value-combining.any.html": false, "header-value-combining.any.worker.html": false, "header-value-null-byte.any.html": true, @@ -3218,20 +3220,8 @@ } }, "content-encoding": { - "bad-gzip-body.any.html": [ - "Consuming the body of a resource with bad gzip content with arrayBuffer() should reject", - "Consuming the body of a resource with bad gzip content with blob() should reject", - "Consuming the body of a resource with bad gzip content with formData() should reject", - "Consuming the body of a resource with bad gzip content with json() should reject", - "Consuming the body of a resource with bad gzip content with text() should reject" - ], - "bad-gzip-body.any.worker.html": [ - "Consuming the body of a resource with bad gzip content with arrayBuffer() should reject", - "Consuming the body of a resource with bad gzip content with blob() should reject", - "Consuming the body of a resource with bad gzip content with formData() should reject", - "Consuming the body of a resource with bad gzip content with json() should reject", - "Consuming the body of a resource with bad gzip content with text() should reject" - ] + "bad-gzip-body.any.html": true, + "bad-gzip-body.any.worker.html": true }, "content-length": { "api-and-duplicate-headers.any.html": [ @@ -3242,9 +3232,7 @@ "XMLHttpRequest and duplicate Content-Length/Content-Type headers", "fetch() and duplicate Content-Length/Content-Type headers" ], - "too-long.window.html": [ - "Content-Length header value of network response exceeds response body" - ] + "too-long.window.html": true }, "content-type": { "multipart.window.html": true |