From b7692508e67156ed3c84cee1044121a1f5e1a641 Mon Sep 17 00:00:00 2001 From: James Opstad <13586373+jamesopstad@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:03:06 +0000 Subject: [PATCH] Removed 405 response from unstable_canFetch --- packages/workers-shared/asset-worker/src/index.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/workers-shared/asset-worker/src/index.ts b/packages/workers-shared/asset-worker/src/index.ts index 3eb6439596ff..13fd18205b59 100644 --- a/packages/workers-shared/asset-worker/src/index.ts +++ b/packages/workers-shared/asset-worker/src/index.ts @@ -117,9 +117,8 @@ export default class extends WorkerEntrypoint { } } - async unstable_canFetch(request: Request): Promise { + async unstable_canFetch(request: Request): Promise { const url = new URL(request.url); - const method = request.method.toUpperCase(); const decodedPathname = decodePath(url.pathname); const intent = await getIntent( decodedPathname, @@ -129,10 +128,6 @@ export default class extends WorkerEntrypoint { }, this.unstable_exists.bind(this) ); - // if asset exists but non GET/HEAD method, 405 - if (intent && ["GET", "HEAD"].includes(method)) { - return new MethodNotAllowedResponse(); - } if (intent === null) { return false; }