1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix(ext/fetch): throw TypeError on read failure (#16219)

This commit is contained in:
Marcos Casagrande 2022-10-12 09:23:33 +02:00 committed by GitHub
parent 2c96f64fa7
commit d47b17d37d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 19 deletions

View file

@ -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()),
}

View file

@ -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