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:
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
|
||||
const _404Request = new Request(`${origin}/404`, request);
|
||||
if (app.match(_404Request)) {
|
||||
return app.render(_404Request);
|
||||
}
|
||||
|
||||
return new Response(null, {
|
||||
status: 404,
|
||||
statusText: 'Not found',
|
||||
|
|
Loading…
Reference in a new issue