fix: @astrojs/clooudflare
404 handling (#3695)
This commit is contained in:
parent
6a6047483b
commit
0d667d0e57
2 changed files with 10 additions and 0 deletions
5
.changeset/five-zoos-look.md
Normal file
5
.changeset/five-zoos-look.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/cloudflare': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix custom 404 pages not rendering
|
|
@ -24,6 +24,11 @@ export function createExports(manifest: SSRManifest) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 404
|
// 404
|
||||||
|
const _404Request = new Request(`${origin}/404`, request);
|
||||||
|
if (app.match(_404Request)) {
|
||||||
|
return app.render(_404Request);
|
||||||
|
}
|
||||||
|
|
||||||
return new Response(null, {
|
return new Response(null, {
|
||||||
status: 404,
|
status: 404,
|
||||||
statusText: 'Not found',
|
statusText: 'Not found',
|
||||||
|
|
Loading…
Reference in a new issue