We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fb9f96 commit 7d6d7f6Copy full SHA for 7d6d7f6
packages/angular/ssr/node/src/response.ts
@@ -8,6 +8,7 @@
8
9
import type { ServerResponse } from 'node:http';
10
import type { Http2ServerResponse } from 'node:http2';
11
+import type { ReadableStreamReadResult } from 'node:stream/web';
12
13
/**
14
* Streams a web-standard `Response` into a Node.js `ServerResponse`
@@ -71,7 +72,10 @@ export async function writeResponseToNodeResponse(
71
72
break;
73
}
74
- (destination as ServerResponse).write(value);
75
+ const canContinue = (destination as ServerResponse).write(value);
76
+ if (!canContinue) {
77
+ await new Promise<void>((resolve) => destination.once('drain', resolve));
78
+ }
79
80
} catch {
81
destination.end('Internal server error.');
0 commit comments