Return a 404 status code when a data route is .notFound
(vercel/turbo#3545)
Returning a 404 status code is required for the client-side router to redirect to the error page.
This commit is contained in:
parent
7409489910
commit
779bb9e06a
1 changed files with 3 additions and 1 deletions
|
@ -206,7 +206,9 @@ export default function startHandler({
|
|||
if (isDataReq) {
|
||||
return {
|
||||
type: "response",
|
||||
statusCode,
|
||||
// Returning a 404 status code is required for the client-side router
|
||||
// to redirect to the error page.
|
||||
statusCode: 404,
|
||||
body: '{"notFound":true}',
|
||||
headers: [["Content-Type", MIME_APPLICATION_JAVASCRIPT]],
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue