ksoichiro / node-archiver-zip-encryptable

An extension for archiver to zip with password encryption.
MIT License
12 stars 1 forks source link

Fix that files without compression cannot be unzipped (#8) #9

Closed ksoichiro closed 5 years ago

ksoichiro commented 5 years ago

Related: #6

When the compression level is 0, zip-stream sets the compression method to 0 (stored), which causes the issue for appending buffer. When using encryption, we need to use data descriptor to use encrypted data size for calculating compressed size. In this fix, ZipCryptoStream._writeLocalFileHeader() is removed and encryption is integrated to ZipCryptoStream._smartStream().