From 4ec92aec503fc3e3ddfab4096208f50825808be4 Mon Sep 17 00:00:00 2001 From: CountBleck Date: Tue, 30 Aug 2022 10:35:54 -0700 Subject: [PATCH] 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. --- static/customBare.mjs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/static/customBare.mjs b/static/customBare.mjs index 038dc38..91afad7 100644 --- a/static/customBare.mjs +++ b/static/customBare.mjs @@ -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'