From c4c2c20bce7f1051349452fc1235d2aa1b8b0b2e Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Mon, 28 Sep 2020 22:45:28 +0800 Subject: [PATCH] Update CFWorkers.js --- CFWorkers.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/CFWorkers.js b/CFWorkers.js index 767e3e5..663bf17 100644 --- a/CFWorkers.js +++ b/CFWorkers.js @@ -19,19 +19,20 @@ addEventListener('fetch', event => { url.protocol = 'https:' response = Response.redirect(url.href); event.respondWith( response ); - } - let nd = new Date(); - if (nd.getDate()%2) { - host = SingleDay } else { - host = DoubleDay - } - if (!CFproxy) { - url.hostname=host; - let request=new Request(url,event.request); - event.respondWith( fetch(request) ) - } else { - event.respondWith( fetchAndApply(event.request) ); + let nd = new Date(); + if (nd.getDate()%2) { + host = SingleDay + } else { + host = DoubleDay + } + if (!CFproxy) { + url.hostname=host; + let request=new Request(url,event.request); + event.respondWith( fetch(request) ) + } else { + event.respondWith( fetchAndApply(event.request) ); + } } })