Skip to content

Commit a9d2934

Browse files
authored
Fix dynamic route param encoding (#78326)
Our encoding test in `vercel/vercel` started failing from #77994 this reverts part of the change there to ensure we always normalize our dynamic route params. Validated in vercel/vercel#13259 <details> <summary>test failure</summary> ![CleanShot 2025-04-12 at 11 10 48@2x](https://github.com/user-attachments/assets/9696ae4a-8db1-420b-8bc6-ba3e43efb1b1) </details> x-ref: [slack thread](https://vercel.slack.com/archives/C02CDC2ALJH/p1744481510502349)
1 parent 916f105 commit a9d2934

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

packages/next/src/server/base-server.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,14 +1249,9 @@ export default abstract class Server<
12491249
if (pageIsDynamic) {
12501250
let params: ParsedUrlQuery | false = {}
12511251

1252-
// If we don't already have valid params, try to parse them from
1253-
// the query params.
1254-
if (!paramsResult.hasValidParams) {
1255-
paramsResult = utils.normalizeDynamicRouteParams(
1256-
queryParams,
1257-
false
1258-
)
1259-
}
1252+
// ensure we normalize the dynamic route params for encoding/
1253+
// default values
1254+
paramsResult = utils.normalizeDynamicRouteParams(queryParams, false)
12601255

12611256
// for prerendered ISR paths we attempt parsing the route
12621257
// params from the URL directly as route-matches may not

0 commit comments

Comments
 (0)