Skip to content

Commit 048ac72

Browse files
committed
Fix proxying with compression
1 parent ef8bdbe commit 048ac72

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

fixtures/flight/server/global.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,13 @@ app.all('/', async function (req, res, next) {
157157
const rscResponse = await promiseForData;
158158
// For other request, we pass-through the RSC payload.
159159
res.set('Content-type', 'text/x-component');
160-
rscResponse.pipe(res);
160+
rscResponse.on('data', data => {
161+
res.write(data);
162+
res.flush();
163+
});
164+
rscResponse.on('end', data => {
165+
res.end();
166+
});
161167
} catch (e) {
162168
console.error(`Failed to proxy request: ${e.stack}`);
163169
res.statusCode = 500;

0 commit comments

Comments
 (0)