@@ -80,6 +80,22 @@ test.describe('Simple Page Router (no basePath, no i18n)', () => {
80
80
revalidateApiBasePath : '/api/revalidate-no-await' ,
81
81
expectedH1Content : 'Product not-prerendered-and-not-awaited-revalidation' ,
82
82
} ,
83
+ {
84
+ label :
85
+ 'prerendered page with dynamic path and awaited res.revalidate() - non-ASCII variant' ,
86
+ prerendered : true ,
87
+ pagePath : '/products/事前レンダリング' ,
88
+ revalidateApiBasePath : '/api/revalidate' ,
89
+ expectedH1Content : 'Product 事前レンダリング' ,
90
+ } ,
91
+ {
92
+ label :
93
+ 'not prerendered page with dynamic path and awaited res.revalidate() - non-ASCII variant' ,
94
+ prerendered : false ,
95
+ pagePath : '/products/事前レンダリングされていない' ,
96
+ revalidateApiBasePath : '/api/revalidate' ,
97
+ expectedH1Content : 'Product 事前レンダリングされていない' ,
98
+ } ,
83
99
] ) {
84
100
test ( label , async ( { page, pollUntilHeadersMatch, pageRouter } ) => {
85
101
// in case there is retry or some other test did hit that path before
@@ -110,7 +126,7 @@ test.describe('Simple Page Router (no basePath, no i18n)', () => {
110
126
const headers1 = response1 ?. headers ( ) || { }
111
127
expect ( response1 ?. status ( ) ) . toBe ( 200 )
112
128
expect ( headers1 [ 'x-nextjs-cache' ] ) . toBeUndefined ( )
113
- expect ( headers1 [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_${ pagePath } ` )
129
+ expect ( headers1 [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_${ encodeURI ( pagePath ) } ` )
114
130
expect ( headers1 [ 'netlify-cdn-cache-control' ] ) . toBe (
115
131
's-maxage=31536000, stale-while-revalidate=31536000, durable' ,
116
132
)
@@ -138,7 +154,7 @@ test.describe('Simple Page Router (no basePath, no i18n)', () => {
138
154
const headers1Json = response1Json ?. headers ( ) || { }
139
155
expect ( response1Json ?. status ( ) ) . toBe ( 200 )
140
156
expect ( headers1Json [ 'x-nextjs-cache' ] ) . toBeUndefined ( )
141
- expect ( headers1Json [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_${ pagePath } ` )
157
+ expect ( headers1Json [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_${ encodeURI ( pagePath ) } ` )
142
158
expect ( headers1Json [ 'netlify-cdn-cache-control' ] ) . toBe (
143
159
's-maxage=31536000, stale-while-revalidate=31536000, durable' ,
144
160
)
@@ -494,7 +510,7 @@ test.describe('Page Router with basePath and i18n', () => {
494
510
const headers1ImplicitLocale = response1ImplicitLocale ?. headers ( ) || { }
495
511
expect ( response1ImplicitLocale ?. status ( ) ) . toBe ( 200 )
496
512
expect ( headers1ImplicitLocale [ 'x-nextjs-cache' ] ) . toBeUndefined ( )
497
- expect ( headers1ImplicitLocale [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_/en${ pagePath } ` )
513
+ expect ( headers1ImplicitLocale [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_/en${ encodeURI ( pagePath ) } ` )
498
514
expect ( headers1ImplicitLocale [ 'netlify-cdn-cache-control' ] ) . toBe (
499
515
's-maxage=31536000, stale-while-revalidate=31536000, durable' ,
500
516
)
@@ -520,7 +536,7 @@ test.describe('Page Router with basePath and i18n', () => {
520
536
const headers1ExplicitLocale = response1ExplicitLocale ?. headers ( ) || { }
521
537
expect ( response1ExplicitLocale ?. status ( ) ) . toBe ( 200 )
522
538
expect ( headers1ExplicitLocale [ 'x-nextjs-cache' ] ) . toBeUndefined ( )
523
- expect ( headers1ExplicitLocale [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_/en${ pagePath } ` )
539
+ expect ( headers1ExplicitLocale [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_/en${ encodeURI ( pagePath ) } ` )
524
540
expect ( headers1ExplicitLocale [ 'netlify-cdn-cache-control' ] ) . toBe (
525
541
's-maxage=31536000, stale-while-revalidate=31536000, durable' ,
526
542
)
@@ -552,7 +568,7 @@ test.describe('Page Router with basePath and i18n', () => {
552
568
const headers1Json = response1Json ?. headers ( ) || { }
553
569
expect ( response1Json ?. status ( ) ) . toBe ( 200 )
554
570
expect ( headers1Json [ 'x-nextjs-cache' ] ) . toBeUndefined ( )
555
- expect ( headers1Json [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_/en${ pagePath } ` )
571
+ expect ( headers1Json [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_/en${ encodeURI ( pagePath ) } ` )
556
572
expect ( headers1Json [ 'netlify-cdn-cache-control' ] ) . toBe (
557
573
's-maxage=31536000, stale-while-revalidate=31536000, durable' ,
558
574
)
@@ -870,7 +886,7 @@ test.describe('Page Router with basePath and i18n', () => {
870
886
const headers1 = response1 ?. headers ( ) || { }
871
887
expect ( response1 ?. status ( ) ) . toBe ( 200 )
872
888
expect ( headers1 [ 'x-nextjs-cache' ] ) . toBeUndefined ( )
873
- expect ( headers1 [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_/de${ pagePath } ` )
889
+ expect ( headers1 [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_/de${ encodeURI ( pagePath ) } ` )
874
890
expect ( headers1 [ 'netlify-cdn-cache-control' ] ) . toBe (
875
891
's-maxage=31536000, stale-while-revalidate=31536000, durable' ,
876
892
)
@@ -899,7 +915,7 @@ test.describe('Page Router with basePath and i18n', () => {
899
915
const headers1Json = response1Json ?. headers ( ) || { }
900
916
expect ( response1Json ?. status ( ) ) . toBe ( 200 )
901
917
expect ( headers1Json [ 'x-nextjs-cache' ] ) . toBeUndefined ( )
902
- expect ( headers1Json [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_/de${ pagePath } ` )
918
+ expect ( headers1Json [ 'netlify-cache-tag' ] ) . toBe ( `_n_t_/de${ encodeURI ( pagePath ) } ` )
903
919
expect ( headers1Json [ 'netlify-cdn-cache-control' ] ) . toBe (
904
920
's-maxage=31536000, stale-while-revalidate=31536000, durable' ,
905
921
)
0 commit comments