Remove event listeners on stream end
This commit is contained in:
parent
02b01d4323
commit
0350f98f98
1 changed files with 2 additions and 0 deletions
|
@ -10,6 +10,8 @@ export function toWebStream(readable: Readable): ReadableStream<Buffer> {
|
|||
let controller: ReadableStreamDefaultController<Buffer>;
|
||||
|
||||
const cleanup = finished(readable, err => {
|
||||
cleanup();
|
||||
|
||||
if (err != null) {
|
||||
return controller.error(err);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue