Skip to content

Commit

Permalink
Update check
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Jul 20, 2023
1 parent c340e58 commit 240c5e3
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions packages/next/src/server/base-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1332,12 +1332,11 @@ export default abstract class Server<ServerOptions extends Options = Options> {
}

if (
!this.renderOpts.dev &&
(hasFallback ||
staticPaths?.includes(resolvedUrlPathname) ||
// this signals revalidation in deploy environments
// TODO: make this more generic
req.headers['x-now-route-matches'])
hasFallback ||
staticPaths?.includes(resolvedUrlPathname) ||
// this signals revalidation in deploy environments
// TODO: make this more generic
req.headers['x-now-route-matches']
) {
isSSG = true
} else if (!this.renderOpts.dev) {
Expand Down Expand Up @@ -1492,7 +1491,15 @@ export default abstract class Server<ServerOptions extends Options = Options> {
if (isAppPath) {
res.setHeader('vary', RSC_VARY_HEADER)

if (!isPreviewMode && isSSG && req.headers[RSC.toLowerCase()]) {
// We don't clear RSC headers in development since SSG doesn't apply
// These headers are cleared for SSG as we need to always generate the
// full RSC response for ISR
if (
!this.renderOpts.dev &&
!isPreviewMode &&
isSSG &&
req.headers[RSC.toLowerCase()]
) {
if (!this.minimalMode) {
isDataReq = true
}
Expand Down

0 comments on commit 240c5e3

Please sign in to comment.