diff --git a/src/run/headers.test.ts b/src/run/headers.test.ts index 4ca423e40..f20bee6a4 100644 --- a/src/run/headers.test.ts +++ b/src/run/headers.test.ts @@ -40,7 +40,7 @@ describe('headers', () => { expect(headers.set).toBeCalledWith( 'netlify-vary', - 'header=x-nextjs-data|x-next-debug-logging,cookie=__prerender_bypass|__next_preview_data', + 'query=__nextDataReq,header=x-nextjs-data|x-next-debug-logging,cookie=__prerender_bypass|__next_preview_data', ) }) @@ -56,7 +56,7 @@ describe('headers', () => { expect(headers.set).toBeCalledWith( 'netlify-vary', - 'header=x-nextjs-data|x-next-debug-logging|Accept|Accept-Language,cookie=__prerender_bypass|__next_preview_data', + 'query=__nextDataReq,header=x-nextjs-data|x-next-debug-logging|Accept|Accept-Language,cookie=__prerender_bypass|__next_preview_data', ) }) @@ -77,7 +77,7 @@ describe('headers', () => { expect(headers.set).toBeCalledWith( 'netlify-vary', - 'header=x-nextjs-data|x-next-debug-logging,cookie=__prerender_bypass|__next_preview_data', + 'query=__nextDataReq,header=x-nextjs-data|x-next-debug-logging,cookie=__prerender_bypass|__next_preview_data', ) }) @@ -97,7 +97,7 @@ describe('headers', () => { expect(headers.set).toBeCalledWith( 'netlify-vary', - 'header=x-nextjs-data|x-next-debug-logging,cookie=__prerender_bypass|__next_preview_data', + 'query=__nextDataReq,header=x-nextjs-data|x-next-debug-logging,cookie=__prerender_bypass|__next_preview_data', ) }) @@ -117,7 +117,7 @@ describe('headers', () => { expect(headers.set).toBeCalledWith( 'netlify-vary', - 'header=x-nextjs-data|x-next-debug-logging,language=en|de|fr,cookie=__prerender_bypass|__next_preview_data|NEXT_LOCALE', + 'query=__nextDataReq,header=x-nextjs-data|x-next-debug-logging,language=en|de|fr,cookie=__prerender_bypass|__next_preview_data|NEXT_LOCALE', ) }) @@ -138,7 +138,7 @@ describe('headers', () => { expect(headers.set).toBeCalledWith( 'netlify-vary', - 'header=x-nextjs-data|x-next-debug-logging,language=en|de|fr,cookie=__prerender_bypass|__next_preview_data|NEXT_LOCALE', + 'query=__nextDataReq,header=x-nextjs-data|x-next-debug-logging,language=en|de|fr,cookie=__prerender_bypass|__next_preview_data|NEXT_LOCALE', ) }) @@ -185,7 +185,7 @@ describe('headers', () => { expect(headers.set).toBeCalledWith( 'netlify-vary', - 'query=item_id|page|per_page,header=x-nextjs-data|x-next-debug-logging|x-custom-header,language=en|de|fr|es,cookie=__prerender_bypass|__next_preview_data|NEXT_LOCALE|ab_test,country=es', + 'query=__nextDataReq|item_id|page|per_page,header=x-nextjs-data|x-next-debug-logging|x-custom-header,language=en|de|fr|es,cookie=__prerender_bypass|__next_preview_data|NEXT_LOCALE|ab_test,country=es', ) }) }) diff --git a/src/run/headers.ts b/src/run/headers.ts index 12c56871a..e1ad53e37 100644 --- a/src/run/headers.ts +++ b/src/run/headers.ts @@ -81,7 +81,7 @@ export const setVaryHeaders = ( header: ['x-nextjs-data', 'x-next-debug-logging'], language: [], cookie: ['__prerender_bypass', '__next_preview_data'], - query: [], + query: ['__nextDataReq'], country: [], }