fix(artifacts): recognize empty Zip64 containers

Fixes #6540
This commit is contained in:
morluto committed 2026-10-23 16:30:34 +08:00
1 parent bcd1f95e68
commit e44ff4666a
2 files changed
+82 -33

No files matched your search

+2 -1
View File
@@ -17,13 +17,14 @@ export const isZipPackageFormat = (
): format is ZipPackageFormat =>
ZIP_PACKAGE_FORMATS.some((candidate) => candidate === format);
/** Recognize local-header, empty-archive, or split-archive ZIP signatures, not archive validity. */
/** Recognize local-header, classic/Zip64 empty-archive, or split ZIP signatures, not validity. */
export const hasZipSignature = (bytes: Uint8Array): boolean =>
bytes.length >= 4 &&
bytes[0] === 0x50 &&
bytes[1] === 0x4b &&
((bytes[2] === 0x03 && bytes[3] === 0x04) ||
(bytes[2] === 0x05 && bytes[3] === 0x06) ||
(bytes[2] === 0x06 && bytes[3] === 0x06) ||
(bytes[2] === 0x07 && bytes[3] === 0x08));
const END_OF_CENTRAL_DIRECTORY = 0x06054b50;