fix: wrong content-length for zip (causing corrupted downloads)
Massimo Melina committed
Jan 19, 2022 at 22:50 UTC
792993d1eba8fe8207a41d5c6c4ad81a3c2c1256
1 file changed
+2
-2
src/QuickZipStream.ts
+2
-2
@@ -52,8 +52,8 @@ export class QuickZipStream extends Readable {
52
const sizeSize = size > ZIP64_LIMIT ? 8 : 4
53
const extraLength = (file.size > ZIP64_LIMIT ? 2 : 0) + (size > ZIP64_LIMIT ? 1 : 0)
54
const extraDataSize = extraLength && (2+2 + extraLength*8)
55
- size += 4+2+2+4+4+4+4+2+2+ pathSize + file.size +4+4 +sizeSize*2
56
- centralDirSize += 4+2+2+2+4+4+4+4+2+2+2+2+2+4+4 + pathSize + extraDataSize
55
+ size += 4+2+2+2+ 4+4+4+4+ 2+2+ pathSize + file.size +4+4 +sizeSize*2
56
+ centralDirSize += 4+2+2+2+2+ 4+4+4+4+ 2+2+2+2+2+ 4+4 + pathSize + extraDataSize
57
}
58
const centralOffset = size
59
if (centralOffset > ZIP64_LIMIT)