diff --git a/packages/next/src/client/components/router-reducer/fetch-server-response.ts b/packages/next/src/client/components/router-reducer/fetch-server-response.ts index 3e0034ff935fc..d98698a16da19 100644 --- a/packages/next/src/client/components/router-reducer/fetch-server-response.ts +++ b/packages/next/src/client/components/router-reducer/fetch-server-response.ts @@ -178,7 +178,7 @@ export async function fetchServerResponse( const interception = !!res.headers.get('vary')?.includes(NEXT_URL) const isPrerender = !!res.headers.get(NEXT_IS_PRERENDER_HEADER) const postponed = !!res.headers.get(NEXT_DID_POSTPONE_HEADER) - let isFlightResponse = contentType === RSC_CONTENT_TYPE_HEADER + let isFlightResponse = contentType.startsWith(RSC_CONTENT_TYPE_HEADER) if (process.env.NODE_ENV === 'production') { if (process.env.__NEXT_CONFIG_OUTPUT === 'export') { diff --git a/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts b/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts index 9b49a5f6ee51f..a65adaf756efc 100644 --- a/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts +++ b/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts @@ -113,7 +113,7 @@ async function fetchServerAction( const contentType = res.headers.get('content-type') - if (contentType === RSC_CONTENT_TYPE_HEADER) { + if (contentType?.startsWith(RSC_CONTENT_TYPE_HEADER)) { const response: ActionFlightResponse = await createFromFetch( Promise.resolve(res), { diff --git a/packages/next/src/server/app-render/action-handler.ts b/packages/next/src/server/app-render/action-handler.ts index ee2b44021976d..6c1bffa84dd56 100644 --- a/packages/next/src/server/app-render/action-handler.ts +++ b/packages/next/src/server/app-render/action-handler.ts @@ -218,7 +218,9 @@ async function createForwardedActionResponse( }, }) - if (response.headers.get('content-type') === RSC_CONTENT_TYPE_HEADER) { + if ( + response.headers.get('content-type')?.startsWith(RSC_CONTENT_TYPE_HEADER) + ) { // copy the headers from the redirect response to the response we're sending for (const [key, value] of response.headers) { if (!actionsForbiddenHeaders.includes(key)) { @@ -340,7 +342,11 @@ async function createRedirectRenderResult( }, }) - if (response.headers.get('content-type') === RSC_CONTENT_TYPE_HEADER) { + if ( + response.headers + .get('content-type') + ?.startsWith(RSC_CONTENT_TYPE_HEADER) + ) { // copy the headers from the redirect response to the response we're sending for (const [key, value] of response.headers) { if (!actionsForbiddenHeaders.includes(key)) {