@@ -387,8 +387,7 @@ describe('page router', () => {
387
} )
387
} )
388
const res = await response . json ( )
388
const res = await response . json ( )
389
const url = new URL ( res . url , 'http://n/' )
389
const url = new URL ( res . url , 'http://n/' )
390
- expect ( url . pathname ) . toBe ( '/ssr-page-2/' )
390
+ expect ( url . pathname ) . toBe ( '/_next/data/build-id/ssr-page-2.json' )
391
- expect ( url . searchParams . get ( '__nextDataReq' ) ) . toBe ( '1' )
392
expect ( res . headers [ 'x-nextjs-data' ] ) . toBe ( '1' )
391
expect ( res . headers [ 'x-nextjs-data' ] ) . toBe ( '1' )
393
expect ( response . headers . get ( 'x-nextjs-rewrite' ) ) . toBe ( '/ssr-page-2/' )
392
expect ( response . headers . get ( 'x-nextjs-rewrite' ) ) . toBe ( '/ssr-page-2/' )
394
expect ( response . status ) . toBe ( 200 )
393
expect ( response . status ) . toBe ( 200 )
@@ -420,7 +419,7 @@ describe('page router', () => {
420
expect ( response . status ) . toBe ( 200 )
419
expect ( response . status ) . toBe ( 200 )
421
} )
420
} )
422
421
423
- test < FixtureTestContext > ( 'should rewrite un-rewritten data requests to page route' , async ( ctx ) => {
422
+ test < FixtureTestContext > ( 'should NOT rewrite un-rewritten data requests to page route' , async ( ctx ) => {
424
await createFixture ( 'middleware-pages' , ctx )
423
await createFixture ( 'middleware-pages' , ctx )
425
await runPlugin ( ctx )
424
await runPlugin ( ctx )
426
const origin = await LocalServer . run ( async ( req , res ) => {
425
const origin = await LocalServer . run ( async ( req , res ) => {
@@ -443,8 +442,7 @@ describe('page router', () => {
443
} )
442
} )
444
const res = await response . json ( )
443
const res = await response . json ( )
445
const url = new URL ( res . url , 'http://n/' )
444
const url = new URL ( res . url , 'http://n/' )
446
- expect ( url . pathname ) . toBe ( '/ssg/hello/' )
445
+ expect ( url . pathname ) . toBe ( '/_next/data/build-id/ssg/hello.json' )
447
- expect ( url . searchParams . get ( '__nextDataReq' ) ) . toBe ( '1' )
448
expect ( res . headers [ 'x-nextjs-data' ] ) . toBe ( '1' )
446
expect ( res . headers [ 'x-nextjs-data' ] ) . toBe ( '1' )
449
expect ( response . status ) . toBe ( 200 )
447
expect ( response . status ) . toBe ( 200 )
450
} )
448
} )
@@ -472,8 +470,7 @@ describe('page router', () => {
472
} )
470
} )
473
const res = await response . json ( )
471
const res = await response . json ( )
474
const url = new URL ( res . url , 'http://n/' )
472
const url = new URL ( res . url , 'http://n/' )
475
- expect ( url . pathname ) . toBe ( '/blog/first/' )
473
+ expect ( url . pathname ) . toBe ( '/_next/data/build-id/blog/first.json' )
476
- expect ( url . searchParams . get ( '__nextDataReq' ) ) . toBe ( '1' )
477
expect ( url . searchParams . get ( 'slug' ) ) . toBe ( 'first' )
474
expect ( url . searchParams . get ( 'slug' ) ) . toBe ( 'first' )
478
expect ( res . headers [ 'x-nextjs-data' ] ) . toBe ( '1' )
475
expect ( res . headers [ 'x-nextjs-data' ] ) . toBe ( '1' )
479
expect ( response . status ) . toBe ( 200 )
476
expect ( response . status ) . toBe ( 200 )
0 commit comments