From 50f00ac4f3ea3fd4881d9ffaaa3d48084712b931 Mon Sep 17 00:00:00 2001 From: William Oldham Date: Mon, 26 Dec 2022 21:23:33 +0000 Subject: [PATCH 1/2] Remove Defunct code from main.js --- src/main.js | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/main.js b/src/main.js index d91c03c..919121c 100644 --- a/src/main.js +++ b/src/main.js @@ -4,20 +4,9 @@ const corsHeaders = { 'Access-Control-Max-Age': '86400', }; -// eslint-disable-next-line no-unused-vars -const allowedDomains = [ - 'https://v2.sg.media-imdb.com', - 'https://gomo.to', - 'https://lookmovie.io', - 'https://gomoplayer.com', - 'https://api.opensubtitles.org', - 'https://www.vmovee.watch', -]; - async function handleRequest(request, destinationUrl, iteration = 0) { console.log( - `PROXYING ${destinationUrl}${ - iteration ? ' ON ITERATION ' + iteration : '' + `PROXYING ${destinationUrl}${iteration ? ' ON ITERATION ' + iteration : '' }`, ); @@ -134,13 +123,6 @@ addEventListener('fetch', (event) => { }), ); } - // else if (!allowedDomains.find(domain => destinationUrl.startsWith(domain))) { - // event.respondWith( - // new Response('404 Not Found', { - // status: 404, - // }), - // ); - // } else if ( request.method === 'GET' || request.method === 'HEAD' || From 6ac4a31ed7fb0680e3efe249996a5b5db80902d2 Mon Sep 17 00:00:00 2001 From: William Oldham Date: Mon, 26 Dec 2022 21:25:03 +0000 Subject: [PATCH 2/2] Fix ESLint errors --- src/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index 919121c..303042d 100644 --- a/src/main.js +++ b/src/main.js @@ -6,7 +6,8 @@ const corsHeaders = { async function handleRequest(request, destinationUrl, iteration = 0) { console.log( - `PROXYING ${destinationUrl}${iteration ? ' ON ITERATION ' + iteration : '' + `PROXYING ${destinationUrl}${ + iteration ? ' ON ITERATION ' + iteration : '' }`, ); @@ -122,8 +123,7 @@ addEventListener('fetch', (event) => { }, }), ); - } - else if ( + } else if ( request.method === 'GET' || request.method === 'HEAD' || request.method === 'POST'