From cc7c09d1991678e7ff43a068a202373ce0307f8d Mon Sep 17 00:00:00 2001 From: Jelle van Snik Date: Sun, 8 Jan 2023 20:27:03 +0100 Subject: [PATCH] fix event error --- src/main.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.js b/src/main.js index 0b4b21c..98888c0 100644 --- a/src/main.js +++ b/src/main.js @@ -59,11 +59,9 @@ async function handleRequest(oRequest, destination, iteration = 0) { ) { // Server tried to redirect too many times if (iteration > 5) { - return event.respondWith( - new Response('418 Too many redirects', { - status: 418, - }), - ); + return new Response('418 Too many redirects', { + status: 418, + }); } // Handle and return the request for the redirected destination