fix(VirtualStream): Ensure writable streams are correctly closed asynchronously to prevent potential sync issues.

This commit is contained in:
2024-10-16 10:08:04 +02:00
parent 7a3a73a244
commit ef5aa9ece3
3 changed files with 7 additions and 2 deletions

View File

@@ -404,7 +404,7 @@ export class VirtualStream<T = Uint8Array> implements plugins.typedRequestInterf
while(this.keepAlive || this.receiveBackpressuredArray.checkHasItems()) {
const value = await this.fetchData();
if (value === closingBit) {
writableStreamArg.close();
await writableStreamArg.close();
break;
}
await writer.write(value);