mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-20 21:42:38 +08:00
fix(@angular/ssr): prevent stream draining if write
does not return a boolean
Implements a workaround for https://github.com/CodeGenieApp/serverless-express/issues/683 Closes #29801
This commit is contained in:
parent
2d03d8f113
commit
ee8466de52
@ -76,7 +76,9 @@ export async function writeResponseToNodeResponse(
|
||||
}
|
||||
|
||||
const canContinue = (destination as ServerResponse).write(value);
|
||||
if (!canContinue) {
|
||||
if (canContinue === false) {
|
||||
// Explicitly check for `false`, as AWS may return `undefined` even though this is not valid.
|
||||
// See: https://github.com/CodeGenieApp/serverless-express/issues/683
|
||||
await new Promise<void>((resolve) => destination.once('drain', resolve));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user