Fix
This commit is contained in:
1 parent
b0c87ce97f
commit
e261c26e78
1 file changed
+3
-6
+3
-6
@@ -91,7 +91,9 @@ function cached(req) {
|
||||
async function answer(input, event) {
|
||||
const req = typeof input === 'string' ? new Request(input) : input;
|
||||
|
||||
try {
|
||||
const hit = await cached(req);
|
||||
if (hit) return hit;
|
||||
|
||||
const res = await fromNetwork(req);
|
||||
if (res && res.ok && res.type === 'basic') {
|
||||
const copy = res.clone();
|
||||
@@ -100,11 +102,6 @@ async function answer(input, event) {
|
||||
else write.catch(() => {});
|
||||
}
|
||||
return res;
|
||||
} catch (err) {
|
||||
const hit = await cached(req);
|
||||
if (hit) return hit;
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
function pageRequest(url) {
|
||||
|
||||
Reference in new issue
Block a user