Remove redundant try block in Cyclone's fetch
The error handling in the catch block led to a bug where the request's body was piped to Cyclone's response. However, since the mock request in the catch block doesn't have a body property, let alone a pipe method, that line throws an error.
This commit is contained in:
parent
1e932d9518
commit
4ec92aec50
1 changed files with 1 additions and 9 deletions
|
|
@ -51,15 +51,7 @@ async function fetchBare(url, res, req) {
|
|||
},
|
||||
}
|
||||
|
||||
try {
|
||||
var request = await fetch(url.href, options);
|
||||
} catch (e) {
|
||||
var request = {
|
||||
text() {
|
||||
return 'Error: ' + e;
|
||||
},
|
||||
}
|
||||
}
|
||||
var request = await fetch(url.href, options);
|
||||
|
||||
try {
|
||||
var contentType = request.headers.get('content-type') || 'application/javascript'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue