From 69f762009cb06da53eb898a6c7759f1a4b77c7de Mon Sep 17 00:00:00 2001 From: srliao <906239+srliao@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:41:38 -0500 Subject: [PATCH] clean up asset endpoint --- ui/packages/workers/src/assets/index.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/ui/packages/workers/src/assets/index.ts b/ui/packages/workers/src/assets/index.ts index fa1ae1323..849d32532 100644 --- a/ui/packages/workers/src/assets/index.ts +++ b/ui/packages/workers/src/assets/index.ts @@ -15,16 +15,12 @@ export async function handleAssets( `Response for request url: ${request.url} not present in cache. Fetching and caching request.`, ); - const x = new URL(request.url); - const resp = await fetch( - new Request(ASSETS_ENDPOINT + x.pathname + x.search), - { - cf: { - cacheTtl: 60 * 24 * 60 * 60, - cacheEverything: true, - }, + const resp = await fetch(new Request(ASSETS_ENDPOINT + cacheUrl.pathname), { + cf: { + cacheTtl: 60 * 24 * 60 * 60, + cacheEverything: true, }, - ); + }); response = new Response(resp.body, resp); response.headers.set('Cache-Control', 'max-age=5184000');