Skip to content

v2.8.38

Choose a tag to compare

@gildas-lormeau gildas-lormeau released this 11 Aug 13:49
· 14 commits to master since this release

What's Changed in v2.8.38

This release makes zip.js resilient to environments without "deflate-raw" support in Compression Streams and to web workers failing silently (e.g. in browser extensions), detects archives with an encrypted central directory, and improves the fidelity of written zip files with other tools.

New features

  • New workerStartupTimeout option in configure(): if a newly created web worker does not respond within this delay (5 seconds by default), it is terminated and the task runs inline transparently. This recovers from workers failing silently without any error event, e.g. worker scripts blocked by the Content Security Policy. Error events raised by workers which have never responded now also trigger the inline fallback instead of making the task fail. As part of this change, streams are only transferred to workers which have proven responsive, workers post a ready message as soon as their script is loaded, and terminateWorkers() re-enables the detection of web worker support
  • New ERR_ENCRYPTED_CENTRAL_DIRECTORY error: ZipReader now detects archives with an encrypted central directory (PKWARE SES, e.g. produced by SecureZIP with filename encryption enabled) via the zip64 end of central directory record or the archive extra data record, and throws a clear error instead of failing with a misleading one
  • Entries encrypted with the strong encryption feature of PKWARE (bit 6 of the general purpose bit flag) are now rejected with ERR_UNSUPPORTED_ENCRYPTION instead of ERR_INVALID_PASSWORD when reading

Bug fixes

  • The automatic fallback on the embedded deflate/inflate implementation did not work when Compression Streams were unavailable or did not support the "deflate-raw" format (e.g. Chromium <= 102, Firefox <= 112, older versions of Node.js), unless useCompressionStream was set to false (#669). The WebAssembly module is now initialized when needed, and its initialization is skipped for entries which do not need it (stored entries and entries using a custom codec)
  • Explicitly passed externalFileAttributes values are now written verbatim, including 0 on directory entries. The msDosCompatible and unix mode options (unixMode, setuid, setgid, sticky) now only override the bits they represent and preserve the other bits (bits 8 to 15 of the DOS attributes were previously dropped when a unix mode was recomposed)

Behavior changes

  • Last modification dates with an odd number of seconds are now rounded up to the next even second in the DOS date/time fields instead of being truncated, consistently with Info-ZIP, 7-Zip, ditto and Windows. The extended timestamp and NTFS extra fields still store the exact date

Full Changelog: v2.8.37...v2.8.38