0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

fix: @astrojs/clooudflare 404 handling (#3695)

This commit is contained in:
Richard Cooke 2022-06-24 20:30:47 +01:00 committed by GitHub
parent 6a6047483b
commit 0d667d0e57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/cloudflare': patch
---
fix custom 404 pages not rendering

View file

@ -24,6 +24,11 @@ export function createExports(manifest: SSRManifest) {
}
// 404
const _404Request = new Request(`${origin}/404`, request);
if (app.match(_404Request)) {
return app.render(_404Request);
}
return new Response(null, {
status: 404,
statusText: 'Not found',