Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cloudflare): Fix 404.astro not being used when routes.strategy is set to exclude #66

Merged
merged 8 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/twelve-grapes-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/cloudflare': minor
ToxiWoxi marked this conversation as resolved.
Show resolved Hide resolved
---

Fix 404 responses in "exclude" routing strategy
ToxiWoxi marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 0 additions & 7 deletions packages/cloudflare/src/entrypoints/server.advanced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export function createExports(manifest: SSRManifest) {
}

let routeData = app.match(request, { matchNotFound: true });
if (routeData) {
Reflect.set(
request,
Symbol.for('astro.clientAddress'),
Expand All @@ -67,12 +66,6 @@ export function createExports(manifest: SSRManifest) {
}

return response;
}

return new Response(null, {
status: 404,
statusText: 'Not found',
});
};

return { default: { fetch } };
Expand Down
7 changes: 0 additions & 7 deletions packages/cloudflare/src/entrypoints/server.directory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export function createExports(manifest: SSRManifest) {
}

let routeData = app.match(request, { matchNotFound: true });
if (routeData) {
Reflect.set(
request,
Symbol.for('astro.clientAddress'),
Expand All @@ -60,12 +59,6 @@ export function createExports(manifest: SSRManifest) {
}

return response;
}

return new Response(null, {
status: 404,
statusText: 'Not found',
});
};

return { onRequest, manifest };
Expand Down