thejoshwolfe / yauzl

yet another unzip library for node
MIT License
737 stars 80 forks source link

Avoid overriding endpointStream.destroy and instead override _destroy so that errors correctly bubble up #141

Closed hideaki closed 9 months ago

hideaki commented 2 years ago

Avoided overriding endpointStream.destroy and instead override _destroy as recommended in the stream doc.

https://nodejs.org/api/stream.html#writabledestroyerror

Implementors should not override this method, but instead implement [writable._destroy()](https://nodejs.org/api/stream.html#writable_destroyerr-callback).

With this change, I was able to capture entry size validation errors, which I could not without the change.

thejoshwolfe commented 9 months ago

I believe I've fixed this in yauzl 3.0.0. Please let me know if you still run into an issue.