@@ -833,6 +833,10 @@ describe('app-dir static/dynamic handling', () => {
833
833
"force-static/first.rsc",
834
834
"force-static/second.html",
835
835
"force-static/second.rsc",
836
+ "gen-params-catch-all-unique/foo/bar.html",
837
+ "gen-params-catch-all-unique/foo/bar.rsc",
838
+ "gen-params-catch-all-unique/foo/foo.html",
839
+ "gen-params-catch-all-unique/foo/foo.rsc",
836
840
"gen-params-dynamic-revalidate/one.html",
837
841
"gen-params-dynamic-revalidate/one.rsc",
838
842
"hooks/use-pathname/slug.html",
@@ -1314,6 +1318,54 @@ describe('app-dir static/dynamic handling', () => {
1314
1318
"initialRevalidateSeconds": false,
1315
1319
"srcRoute": "/force-static/[slug]",
1316
1320
},
1321
+ "/gen-params-catch-all-unique/foo/bar": {
1322
+ "allowHeader": [
1323
+ "host",
1324
+ "x-matched-path",
1325
+ "x-prerender-revalidate",
1326
+ "x-prerender-revalidate-if-generated",
1327
+ "x-next-revalidated-tags",
1328
+ "x-next-revalidate-tag-token",
1329
+ ],
1330
+ "dataRoute": "/gen-params-catch-all-unique/foo/bar.rsc",
1331
+ "experimentalBypassFor": [
1332
+ {
1333
+ "key": "Next-Action",
1334
+ "type": "header",
1335
+ },
1336
+ {
1337
+ "key": "content-type",
1338
+ "type": "header",
1339
+ "value": "multipart/form-data;.*",
1340
+ },
1341
+ ],
1342
+ "initialRevalidateSeconds": false,
1343
+ "srcRoute": "/gen-params-catch-all-unique/[...slug]",
1344
+ },
1345
+ "/gen-params-catch-all-unique/foo/foo": {
1346
+ "allowHeader": [
1347
+ "host",
1348
+ "x-matched-path",
1349
+ "x-prerender-revalidate",
1350
+ "x-prerender-revalidate-if-generated",
1351
+ "x-next-revalidated-tags",
1352
+ "x-next-revalidate-tag-token",
1353
+ ],
1354
+ "dataRoute": "/gen-params-catch-all-unique/foo/foo.rsc",
1355
+ "experimentalBypassFor": [
1356
+ {
1357
+ "key": "Next-Action",
1358
+ "type": "header",
1359
+ },
1360
+ {
1361
+ "key": "content-type",
1362
+ "type": "header",
1363
+ "value": "multipart/form-data;.*",
1364
+ },
1365
+ ],
1366
+ "initialRevalidateSeconds": false,
1367
+ "srcRoute": "/gen-params-catch-all-unique/[...slug]",
1368
+ },
1317
1369
"/gen-params-dynamic-revalidate/one": {
1318
1370
"allowHeader": [
1319
1371
"host",
@@ -2430,6 +2482,31 @@ describe('app-dir static/dynamic handling', () => {
2430
2482
"fallback": null,
2431
2483
"routeRegex": "^\\/force\\-static\\/([^\\/]+?)(?:\\/)?$",
2432
2484
},
2485
+ "/gen-params-catch-all-unique/[...slug]": {
2486
+ "allowHeader": [
2487
+ "host",
2488
+ "x-matched-path",
2489
+ "x-prerender-revalidate",
2490
+ "x-prerender-revalidate-if-generated",
2491
+ "x-next-revalidated-tags",
2492
+ "x-next-revalidate-tag-token",
2493
+ ],
2494
+ "dataRoute": "/gen-params-catch-all-unique/[...slug].rsc",
2495
+ "dataRouteRegex": "^\\/gen\\-params\\-catch\\-all\\-unique\\/(.+?)\\.rsc$",
2496
+ "experimentalBypassFor": [
2497
+ {
2498
+ "key": "Next-Action",
2499
+ "type": "header",
2500
+ },
2501
+ {
2502
+ "key": "content-type",
2503
+ "type": "header",
2504
+ "value": "multipart/form-data;.*",
2505
+ },
2506
+ ],
2507
+ "fallback": false,
2508
+ "routeRegex": "^\\/gen\\-params\\-catch\\-all\\-unique\\/(.+?)(?:\\/)?$",
2509
+ },
2433
2510
"/gen-params-dynamic-revalidate/[slug]": {
2434
2511
"allowHeader": [
2435
2512
"host",
@@ -3678,6 +3755,13 @@ describe('app-dir static/dynamic handling', () => {
3678
3755
} )
3679
3756
3680
3757
if ( ! process . env . CUSTOM_CACHE_HANDLER ) {
3758
+ it ( 'should not filter out catch-all params with repeated segments in generateStaticParams' , async ( ) => {
3759
+ const res1 = await next . fetch ( '/gen-params-catch-all-unique/foo/foo' )
3760
+ expect ( res1 . status ) . toBe ( 200 )
3761
+ const res2 = await next . fetch ( '/gen-params-catch-all-unique/foo/bar' )
3762
+ expect ( res2 . status ) . toBe ( 200 )
3763
+ } )
3764
+
3681
3765
it ( 'should honor dynamic = "force-static" correctly' , async ( ) => {
3682
3766
const res = await next . fetch ( '/force-static/first' )
3683
3767
expect ( res . status ) . toBe ( 200 )
0 commit comments