Skip to content

Commit

Permalink
fix: content type (#6616)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjun1011 authored Nov 1, 2023
1 parent 6198eea commit 67dc6e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/runtime/src/runRSCClientApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ export function useRefresh() {
}

function getReactTree(location) {
return fetch(location + (location.indexOf('?') > -1 ? '&rsc' : '?rsc'));
return fetch(location + (location.indexOf('?') > -1 ? '&rsc=true' : '?rsc=true'));
}
3 changes: 2 additions & 1 deletion packages/runtime/src/runRSCServerApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function runRSCServerApp(serverContext: ServerContext, renderOption
matches: [],
};

if (req.url?.indexOf('rsc') === -1) {
if (req.url?.indexOf('rsc=true') === -1) {
return renderDocument(serverContext, renderOptions, appContext, matches);
}

Expand All @@ -71,6 +71,7 @@ export async function runRSCServerApp(serverContext: ServerContext, renderOption
}
});

res.setHeader('Content-Type', 'text/x-component; charset=utf-8');
const { pipe } = renderToPipeableStream(
element,
clientManifest,
Expand Down

0 comments on commit 67dc6e9

Please sign in to comment.