[next]: Fix RSC rewrite behavior (#10415)

- Removes some of the hacks from #10388 that were attempting to resolve an issue with RSC prefetches to `pages` routes in favor of adding rsc rewrites for all dynamic paths, and letting it fall through to a 404 if there's no match
- Fixes an issue where RSC requests were matching the wrong path (filesystem rather than RSC variant) introduced in above mentioned change
  - Closes https://github.com/vercel/next.js/issues/54698
This commit is contained in:
Zack Tanner
2023-09-07 07:03:14 -07:00
committed by GitHub
parent 43048a0dd8
commit c3c54d6e69
10 changed files with 115 additions and 69 deletions

View File

@@ -220,6 +220,16 @@ async function runProbe(probe, deploymentId, deploymentUrl, ctx) {
hadTest = true;
}
if (probe.bodyMustBe) {
if (text !== probe.bodyMustBe) {
throw new Error(
`Fetched page ${probeUrl} does not have an exact body match of ${probe.bodyMustBe}. Content: ${text}`
);
}
hadTest = true;
}
/**
* @type Record<string, string[]>
*/