diff --git a/docs/pages/404.tsx b/docs/pages/404.tsx index 0478f55a62a..e9984dacc1b 100644 --- a/docs/pages/404.tsx +++ b/docs/pages/404.tsx @@ -29,11 +29,13 @@ function ConstructionIllustration() { ); } +// Modifying this code may have security implications +// See.. https://github.com/keystonejs/keystone/pull/6411#issuecomment-906085389 const v5PathList = ['/tutorials', '/guides', '/keystonejs', '/api', '/discussions']; export default function NotFoundPage() { const { asPath } = useRouter(); - const tryV5Link = v5PathList.some(i => asPath.startsWith(i)); + const tryV5Link = asPath.startsWith('/') && v5PathList.some(i => asPath.startsWith(i)); return (
If you were looking for a page in the Keystone 5 docs, try{' '} - v5.keystonejs.com{asPath}. + https://v5.keystonejs.com{asPath}. ) : null}