You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor internal routing headers to use request meta (#66987)
This refactors our handling of passing routing information to the render
logic via headers which is legacy from when we had separate routing and
render workers. Now this will just attach this meta in our normal
request meta handling which is more consistent and type safe.
message: `A conflicting public file and page file was found for path ${matchedOutput.itemPath} https://nextjs.org/docs/messages/conflicting-public-file-page`,
410
-
}),
410
+
invokeStatus: 500,
411
+
invokeError: newError(
412
+
`A conflicting public file and page file was found for path ${matchedOutput.itemPath} https://nextjs.org/docs/messages/conflicting-public-file-page`
413
+
),
411
414
})
412
415
return
413
416
}
@@ -433,7 +436,7 @@ export async function initialize(opts: {
433
436
'/405',
434
437
handleIndex,
435
438
{
436
-
'x-invoke-status': '405',
439
+
invokeStatus: 405,
437
440
}
438
441
)
439
442
}
@@ -491,14 +494,14 @@ export async function initialize(opts: {
491
494
492
495
if(typeoferr.statusCode==='number'){
493
496
constinvokePath=`/${err.statusCode}`
494
-
constinvokeStatus=`${err.statusCode}`
497
+
constinvokeStatus=err.statusCode
495
498
res.statusCode=err.statusCode
496
499
returnawaitinvokeRender(
497
500
url.parse(invokePath,true),
498
501
invokePath,
499
502
handleIndex,
500
503
{
501
-
'x-invoke-status': invokeStatus,
504
+
invokeStatus,
502
505
}
503
506
)
504
507
}
@@ -514,7 +517,7 @@ export async function initialize(opts: {
514
517
parsedUrl.pathname||'/',
515
518
handleIndex,
516
519
{
517
-
'x-invoke-output': matchedOutput.itemPath,
520
+
invokeOutput: matchedOutput.itemPath,
518
521
}
519
522
)
520
523
}
@@ -544,13 +547,13 @@ export async function initialize(opts: {
544
547
UNDERSCORE_NOT_FOUND_ROUTE,
545
548
handleIndex,
546
549
{
547
-
'x-invoke-status': '404',
550
+
invokeStatus: 404,
548
551
}
549
552
)
550
553
}
551
554
552
555
awaitinvokeRender(parsedUrl,'/404',handleIndex,{
553
-
'x-invoke-status': '404',
556
+
invokeStatus: 404,
554
557
})
555
558
}
556
559
@@ -569,7 +572,7 @@ export async function initialize(opts: {
0 commit comments