Merged in feat/SW-2111 (pull request #1761)
feat(SW-2111): add initial scandic-redirect * feat(SW-2111): add initial scandic-redirect * feat(SW-2112): add scandic-redirect call to middleware * chore: add redirect jsons per lang * fix: handle incorrect contentTypes * fix: handle lang * refactor: add json streaming * refactor: wrap redirect call in cacheOrGet * refactor: review Approved-by: Michael Zetterberg
This commit is contained in:
@@ -63,9 +63,10 @@ export const middleware: NextMiddleware = async (request) => {
|
||||
}
|
||||
|
||||
if (!contentType || !uid) {
|
||||
throw notFound(
|
||||
`Unable to resolve CMS entry for page "${pathWithoutTrailingSlash}"`
|
||||
)
|
||||
const headers = getDefaultRequestHeaders(request)
|
||||
headers.set("x-continue", "1")
|
||||
|
||||
return NextResponse.next({ headers })
|
||||
}
|
||||
const headers = getDefaultRequestHeaders(request)
|
||||
headers.set("x-uid", uid)
|
||||
|
||||
Reference in New Issue
Block a user