diff --git a/app/[locale]/feed/[feed]/route.ts b/app/[locale]/feed/[feed]/route.ts index 9ba74061e0992..a77e9d9ccd3b4 100644 --- a/app/[locale]/feed/[feed]/route.ts +++ b/app/[locale]/feed/[feed]/route.ts @@ -29,7 +29,9 @@ export const GET = async (_: Request, { params }: StaticParams) => { export const generateStaticParams = async () => siteConfig.rssFeeds.map(feed => ({ feed: feed.file, locale })); -// Forces that only the paths from `generateStaticParams` are allowed, giving 404 on the contrary +// In this case we want to catch-all possible requests. This is so that if a non defined feed is +// requested we can manually return a 404 response for it instead of having Next.js handle it +// and return our top level custom 404 html page instead // @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams export const dynamicParams = true; diff --git a/app/[locale]/next-data/og/route.tsx b/app/[locale]/next-data/og/route.tsx index 6c0626c2011c6..481826099722c 100644 --- a/app/[locale]/next-data/og/route.tsx +++ b/app/[locale]/next-data/og/route.tsx @@ -64,7 +64,8 @@ export const generateStaticParams = async () => [ // @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#runtime export const runtime = VERCEL_ENV ? 'edge' : 'nodejs'; -// Enforces that only the paths from `generateStaticParams` are allowed, giving 404 on the contrary +// In this case we want to catch-all possible requests. This ensures that we always generate and +// serve the OpenGrapgh images independently on the locale // @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams export const dynamicParams = true;