From 64c1047f7e08cd080de3e507aa5c9f31b68f7de6 Mon Sep 17 00:00:00 2001 From: Isaac McFadyen <6243993+mcfadyeni@users.noreply.github.com> Date: Tue, 21 Dec 2021 16:28:42 -0500 Subject: [PATCH] Fixed formatting issues. --- packages/adapter-cloudflare/files/worker.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/adapter-cloudflare/files/worker.js b/packages/adapter-cloudflare/files/worker.js index 668fe053ace4..df9fea234039 100644 --- a/packages/adapter-cloudflare/files/worker.js +++ b/packages/adapter-cloudflare/files/worker.js @@ -6,14 +6,15 @@ init(); export default { async fetch(req, env) { const url = new URL(req.url); + // check generated asset_set for static files - let pathname = url.pathname.substring(1); - try { - pathname = decodeURIComponent(pathname); - } catch (err) { - // ignore - } - + let pathname = url.pathname.substring(1); + try { + pathname = decodeURIComponent(pathname); + } catch (err) { + // ignore + } + if (ASSETS.has(pathname)) { return env.ASSETS.fetch(req); }