Skip to content

Commit b0706c3

Browse files
authored
Disable rewrite-headers tests that are dependent on Vercel site config (#75647)
The two scenarios that test rewrite headers for vercel.com are dependent on how the Vercel site has currently configured its rewrites, and thus are prone to be flaky. Until we've figured out what Next.js logic this is supposed to test, and how we can decouple it from this external source, we are disabling them to unblock other PRs. An attempt to fix the expectation was done yesterday in #75602, but in the meantime the returned `x-nextjs-rewritten-path` header has changed again (`/home/eyJhbGciOiJIUzI1NiJ9.AP0.7cQg-Q2tj1BAyHFfT32HLI3JRdEfYCiANjbtqRiDfLs`).
1 parent 879e279 commit b0706c3

File tree

1 file changed

+28
-25
lines changed

1 file changed

+28
-25
lines changed

test/e2e/app-dir/rewrite-headers/rewrite-headers.test.ts

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -308,31 +308,34 @@ const cases: {
308308
'x-nextjs-rewritten-query': null,
309309
},
310310
},
311-
{
312-
name: 'middleware rewrite external RSC',
313-
pathname: '/hello/vercel',
314-
headers: {
315-
RSC: '1',
316-
},
317-
expected: {
318-
// Vercel matches `/` to `/home`
319-
'x-nextjs-rewritten-path': '/home',
320-
'x-nextjs-rewritten-query': null,
321-
},
322-
},
323-
{
324-
name: 'middleware rewrite external Prefetch RSC',
325-
pathname: '/hello/vercel',
326-
headers: {
327-
RSC: '1',
328-
'Next-Router-Prefetch': '1',
329-
},
330-
expected: {
331-
// Vercel matches `/` to `/home`
332-
'x-nextjs-rewritten-path': '/home',
333-
'x-nextjs-rewritten-query': null,
334-
},
335-
},
311+
// TODO: These next two scenarios are dependent on how the Vercel site has
312+
// configured its rewrites, and thus are prone to be flaky. Figure out what
313+
// Next.js logic this is supposed to test.
314+
// {
315+
// name: 'middleware rewrite external RSC',
316+
// pathname: '/hello/vercel',
317+
// headers: {
318+
// RSC: '1',
319+
// },
320+
// expected: {
321+
// // Vercel matches `/` to `/home`
322+
// 'x-nextjs-rewritten-path': '/home',
323+
// 'x-nextjs-rewritten-query': null,
324+
// },
325+
// },
326+
// {
327+
// name: 'middleware rewrite external Prefetch RSC',
328+
// pathname: '/hello/vercel',
329+
// headers: {
330+
// RSC: '1',
331+
// 'Next-Router-Prefetch': '1',
332+
// },
333+
// expected: {
334+
// // Vercel matches `/` to `/home`
335+
// 'x-nextjs-rewritten-path': '/home',
336+
// 'x-nextjs-rewritten-query': null,
337+
// },
338+
// },
336339
{
337340
name: 'next.config.js rewrites with query HTML',
338341
pathname: '/hello/fred',

0 commit comments

Comments
 (0)