diff options
author | 2023-08-01 09:52:16 -0500 | |
---|---|---|
committer | 2023-08-01 09:52:16 -0500 | |
commit | 298dbb89f2963a547370b6e65cafd2650fdb1b27 (patch) | |
tree | 6650c12dc5985f5d700319b3fc4a3826fbc40070 /packages/integrations/netlify/src/netlify-functions.ts | |
parent | 0b8375fe82a15bfff3f517f98de6454adb2779f1 (diff) | |
download | astro-298dbb89f2963a547370b6e65cafd2650fdb1b27.tar.gz astro-298dbb89f2963a547370b6e65cafd2650fdb1b27.tar.zst astro-298dbb89f2963a547370b6e65cafd2650fdb1b27.zip |
Refactor 404 and 500 approach (#7754)
* fix(app): refactor 404 and 500 approach
* chore: refactor logic
* fix: always treat error as page
* test: migrate ssr-prerender-404 to node adapter
* feat: merge original response metadata with error response
* chore: update lockfile
* chore: trigger ci
* chore(lint): fix lint issue
* fix: ensure merged request has proper status
* fix(node): prerender test
* chore: update test label
* fix(node): improve 404 behavior in middleware mode
* fix(vercel): improve 404 behavior
* fix(netlify): improve 404 behavior
* chore: update test labels
* chore: force ci
* chore: fix lint
* fix: avoid infinite loops
* test: fix failing test in Node 18
* chore: remove volta
Diffstat (limited to 'packages/integrations/netlify/src/netlify-functions.ts')
-rw-r--r-- | packages/integrations/netlify/src/netlify-functions.ts | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/packages/integrations/netlify/src/netlify-functions.ts b/packages/integrations/netlify/src/netlify-functions.ts index 8d0196d5e..cc6636ec4 100644 --- a/packages/integrations/netlify/src/netlify-functions.ts +++ b/packages/integrations/netlify/src/netlify-functions.ts @@ -70,15 +70,7 @@ export const createExports = (manifest: SSRManifest, args: Args) => { } const request = new Request(rawUrl, init); - let routeData = app.match(request, { matchNotFound: true }); - - if (!routeData) { - return { - statusCode: 404, - body: 'Not found', - }; - } - + const routeData = app.match(request); const ip = headers['x-nf-client-connection-ip']; Reflect.set(request, clientAddressSymbol, ip); let locals = {}; |