diff --git a/.changeset/twelve-grapes-dream.md b/.changeset/twelve-grapes-dream.md new file mode 100644 index 00000000..90f0cf40 --- /dev/null +++ b/.changeset/twelve-grapes-dream.md @@ -0,0 +1,5 @@ +--- +'@astrojs/cloudflare': patch +--- + +Fixes a regression which caused the adapter to falsely return an empty 404 response, caused by an upstream change https://github.com/withastro/astro/pull/7754. diff --git a/packages/cloudflare/src/entrypoints/server.advanced.ts b/packages/cloudflare/src/entrypoints/server.advanced.ts index 283197fd..cfb5ac68 100644 --- a/packages/cloudflare/src/entrypoints/server.advanced.ts +++ b/packages/cloudflare/src/entrypoints/server.advanced.ts @@ -39,8 +39,7 @@ export function createExports(manifest: SSRManifest) { return env.ASSETS.fetch(request); } - let routeData = app.match(request, { matchNotFound: true }); - if (routeData) { + let routeData = app.match(request); Reflect.set( request, Symbol.for('astro.clientAddress'), @@ -67,12 +66,6 @@ export function createExports(manifest: SSRManifest) { } return response; - } - - return new Response(null, { - status: 404, - statusText: 'Not found', - }); }; return { default: { fetch } }; diff --git a/packages/cloudflare/src/entrypoints/server.directory.ts b/packages/cloudflare/src/entrypoints/server.directory.ts index f44d23ab..1156f09a 100644 --- a/packages/cloudflare/src/entrypoints/server.directory.ts +++ b/packages/cloudflare/src/entrypoints/server.directory.ts @@ -32,8 +32,7 @@ export function createExports(manifest: SSRManifest) { return env.ASSETS.fetch(request); } - let routeData = app.match(request, { matchNotFound: true }); - if (routeData) { + let routeData = app.match(request); Reflect.set( request, Symbol.for('astro.clientAddress'), @@ -60,12 +59,6 @@ export function createExports(manifest: SSRManifest) { } return response; - } - - return new Response(null, { - status: 404, - statusText: 'Not found', - }); }; return { onRequest, manifest };