From b031e7b223a6c288cb6fc6d93d8fd79dcfbdfc40 Mon Sep 17 00:00:00 2001 From: Gabriel Massadas Date: Sun, 15 Dec 2024 17:06:29 +0000 Subject: [PATCH] Fix spa worker proxy --- packages/worker/src/modules/dashboard.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/worker/src/modules/dashboard.ts b/packages/worker/src/modules/dashboard.ts index fc6fad4..20fffc8 100644 --- a/packages/worker/src/modules/dashboard.ts +++ b/packages/worker/src/modules/dashboard.ts @@ -25,15 +25,7 @@ export async function dashboardRedirect(c: AppContext, next) { const url = new URL(c.req.url); if (!url.pathname.includes(".")) { - // This is required for SPA - return fetch(`${url.origin}/`, { - cf: { - // Always cache this fetch regardless of content type - // for a max of 60 seconds before revalidating the resource - cacheTtl: 60, - cacheEverything: true, - }, - }); + return c.env.ASSETS.fetch(new Request(url.origin)); } await next();