From 25a076d6382364be37575a09bf66939e34e6ac4c Mon Sep 17 00:00:00 2001 From: Jack Carter <128555021+SunsetDrifter@users.noreply.github.com> Date: Mon, 3 Aug 2026 10:57:42 +0200 Subject: [PATCH] fix: serve page props for API docs on client-side navigation The /ipa/:path* -> /api/:path* redirect also matched Next.js data requests (/_next/data/.../ipa/...), returning a 308 instead of page props. Client-side navigations to API pages therefore lost pageProps, leaving the sidebar method list collapsed and the tab title undefined until a full reload. Skip the redirect when the x-nextjs-data header is present so props fetches go through; browser visits to /ipa/* still get the canonical redirect to /api/*. --- next.config.mjs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/next.config.mjs b/next.config.mjs index 111b35ce9..d72c28c30 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -103,7 +103,16 @@ const nextConfig = { { source: '/ipa/:path*', destination: '/api/:path*', - permanent: true + permanent: true, + // Client-side navigations fetch page props from + // /_next/data//ipa/... — redirecting those requests + // strips pageProps (title, sections), so skip data requests. + missing: [ + { + type: 'header', + key: 'x-nextjs-data', + }, + ], }, // documentation redirects for about {