Skip to content

Commit

Permalink
fix(common:stream): always call cb in _transform
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieusieben committed Feb 19, 2024
1 parent 2b1c66e commit 7b53e73
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/common/src/streams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ export class MaxSizeChecker extends Transform {
_transform(chunk: Uint8Array, _enc: BufferEncoding, cb: TransformCallback) {
this.totalSize += chunk.length
if (this.totalSize > this.maxSize) {
return this.destroy(this.createError())
cb(this.createError())
} else {
cb(null, chunk)
}
return cb(null, chunk)
}
}

0 comments on commit 7b53e73

Please sign in to comment.