Merged in chore/more-partner-sas-boilerplate (pull request #2756)
chore: Misc for partner-sas * Add global-error to partner-sas * Add redirect to lang in partner-sas * Actually use language from param * Increase test timeouts and use parsed lang to fix tests * Remove need to import serverClient to setup trpc Approved-by: Hrishikesh Vaipurkar
This commit is contained in:
@@ -23,16 +23,11 @@ export const middleware: NextMiddleware = async (request, event) => {
|
||||
|
||||
// Default to English if no lang is found.
|
||||
headers.set("x-lang", Lang.en)
|
||||
return NextResponse.rewrite(
|
||||
new URL(`/${Lang.en}/middleware-error/404`, request.nextUrl),
|
||||
{
|
||||
request: {
|
||||
headers,
|
||||
},
|
||||
status: 404,
|
||||
statusText: "Not found",
|
||||
}
|
||||
)
|
||||
return NextResponse.next({
|
||||
request: {
|
||||
headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// Note that the order of middlewares is important since that is the order they are matched by.
|
||||
|
||||
Reference in New Issue
Block a user