[next] Fix missing initial RSC headers (#11552)

While investigating https://github.com/vercel/next.js/issues/59883 we noticed the RSC Prerender did not have all the expected headers like the HTML Prerender which caused unexpected revalidation behavior specifically on client-transition as some of these headers are used to detect if a revalidated tag is associated with specific outputs. 

x-ref: https://github.com/vercel/next.js/issues/59883
This commit is contained in:
JJ Kasper
2024-05-07 00:43:00 -07:00
committed by GitHub
parent c1d8522950
commit 5a532a5b94
2 changed files with 6 additions and 0 deletions

View File

@@ -2465,6 +2465,7 @@ export const onPrerenderRoute =
...(rscEnabled
? {
initialHeaders: {
...initialHeaders,
'content-type': rscContentTypeHeader,
vary: rscVaryHeader,
// If it contains a pre-render, then it was postponed.