Skip to content

Commit 83a1183

Browse files
committed
zip: ensure version to extract is updated.
1 parent 70d91ce commit 83a1183

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/archivers/zip/zip-archive-output-stream.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ ZipArchiveOutputStream.prototype._appendBuffer = function(ae, source, callback)
8787

8888
ZipArchiveOutputStream.prototype._appendStream = function(ae, source, callback) {
8989
ae.getGeneralPurposeBit().useDataDescriptor(true);
90+
ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR);
9091

9192
this._writeLocalFileHeader(ae);
9293

@@ -215,7 +216,7 @@ ZipArchiveOutputStream.prototype._writeCentralDirectoryZip64 = function() {
215216
// version made by
216217
this.write(zipUtil.getShortBytes((ae.getPlatform() << 8) | constants.VERSION_MADEBY));
217218

218-
// version needed to extract
219+
// version to extract
219220
this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract()));
220221

221222
// disk numbers
@@ -361,6 +362,7 @@ ZipArchiveOutputStream.prototype._writeLocalFileHeader = function(ae) {
361362

362363
if (ae.isZip64()) {
363364
gpb.useDataDescriptor(true);
365+
ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64);
364366
}
365367

366368
if (gpb.usesUTF8ForNames()) {

0 commit comments

Comments
 (0)