Merged in fix/SW-1801-return-not-found-on-non-existing-routes (pull request #1462)
fix(SW-1801): Prevent resolving subpages for start page * fix(SW-1801): Prevent resolving subpages for start page Approved-by: Linus Flood
This commit is contained in:
@@ -43,6 +43,11 @@ export const middleware: NextMiddleware = async (request) => {
|
||||
contentType = parentContentType
|
||||
uid = parentUid
|
||||
switch (parentContentType) {
|
||||
// If the parent is the startpage, we should not be able to resolve a subpage.
|
||||
case PageContentTypeEnum.startPage:
|
||||
throw notFound(
|
||||
`Unable to resolve CMS entry for page "${pathWithoutTrailingSlash}"`
|
||||
)
|
||||
case PageContentTypeEnum.hotelPage:
|
||||
// E.g. Dedicated pages for restaurant, parking etc.
|
||||
searchParams.set("subpage", subpage)
|
||||
|
||||
Reference in New Issue
Block a user