mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 04:22:07 +00:00
[now-next] Make sure to 404 and clear cache header for invalid _next requests (#3801)
This handles an edge case where deeply nested dynamic routes were handling `_next` 404s that were cached forever since the immutable header we set isn't cleared after not matching on the filesystem. I updated our cache-header fixture to check for this edge case also to make sure we don't regress on this
This commit is contained in:
@@ -163,6 +163,21 @@ async function testDeployment(
|
||||
);
|
||||
}
|
||||
});
|
||||
} else if (probe.notResponseHeaders) {
|
||||
Object.keys(probe.notResponseHeaders).forEach(header => {
|
||||
const headerValue = resp.headers.get(header);
|
||||
const expected = probe.notResponseHeaders[header];
|
||||
|
||||
if (headerValue === expected) {
|
||||
const headers = Array.from(resp.headers.entries())
|
||||
.map(([k, v]) => ` ${k}=${v}`)
|
||||
.join('\n');
|
||||
|
||||
throw new Error(
|
||||
`Page ${probeUrl} invalid page header ${header}.\n\n Did not expect: ${header}=${expected}.\nBut got ${headers}`
|
||||
);
|
||||
}
|
||||
});
|
||||
} else if (!probe.status) {
|
||||
assert(false, 'probe must have a test condition');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user