9
9
10
10
import RenderResult from '../render-result'
11
11
import { RouteKind } from '../route-kind'
12
+ import { RedirectStatusCode } from '../../client/components/redirect-status-code'
12
13
13
14
export async function fromResponseCacheEntry (
14
15
cacheEntry : ResponseCacheEntry
@@ -39,7 +40,8 @@ export async function fromResponseCacheEntry(
39
40
}
40
41
41
42
export async function toResponseCacheEntry (
42
- response : IncrementalResponseCacheEntry | null
43
+ response : IncrementalResponseCacheEntry | null ,
44
+ { isRscRequest } : { isRscRequest : boolean }
43
45
) : Promise < ResponseCacheEntry | null > {
44
46
if ( ! response ) return null
45
47
@@ -62,7 +64,14 @@ export async function toResponseCacheEntry(
62
64
html : RenderResult . fromStatic ( response . value . html ) ,
63
65
rscData : response . value . rscData ,
64
66
headers : response . value . headers ,
65
- status : response . value . status ,
67
+ status :
68
+ // RSC redirect is embedded in the payload itself and handled by client router directly
69
+ // This makes it consistent with how it's handled in minimalMode
70
+ isRscRequest &&
71
+ response . value . status &&
72
+ RedirectStatusCode [ response . value . status ]
73
+ ? 200
74
+ : response . value . status ,
66
75
postponed : response . value . postponed ,
67
76
segmentData : response . value . segmentData ,
68
77
} satisfies CachedAppPageValue )
0 commit comments