Skip to content

Commit

Permalink
docs: Update mixed routing example with improved compatibility for Se…
Browse files Browse the repository at this point in the history
…rver Actions (#1187)

Passing the request headers as response headers messes with server
actions. vercel/next.js#50659

We need to pass the updated request headers to the NextResponse's
request object.

---------

Co-authored-by: Jan Amann <jan@amann.work>
  • Loading branch information
imCorfitz and amannn authored Jul 10, 2024
1 parent 4f228e4 commit 077a0ca
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function middleware(request: NextRequest) {
if (isAppRoute) {
// Add a hint that we can read in `i18n.ts`
request.headers.set('x-app-route', 'true');
return NextResponse.next({headers: request.headers});
return NextResponse.next({request: {headers: request.headers}});
} else {
return intlMiddleware(request);
}
Expand Down

0 comments on commit 077a0ca

Please sign in to comment.