Skip to content

Commit 6ff93c9

Browse files
alexfriesenalan-agius4
authored andcommitted
refactor(@angular/ssr): drain node stream
(cherry picked from commit 57ae111)
1 parent d53d25f commit 6ff93c9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/angular/ssr/node/src/response.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ export async function writeResponseToNodeResponse(
7171
break;
7272
}
7373

74-
(destination as ServerResponse).write(value);
74+
const canContinue = (destination as ServerResponse).write(value);
75+
if (!canContinue) {
76+
await new Promise<void>((resolve) => destination.once('drain', resolve));
77+
}
7578
}
7679
} catch {
7780
destination.end('Internal server error.');

0 commit comments

Comments
 (0)