From 914534588237e3285cd5e90e943ed6440718bad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Sun, 12 Jul 2026 15:01:33 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B1=D0=B0=D0=B3=20=D0=B2=20unzip()=20?= =?UTF-8?q?=E2=80=94=20=D0=BD=D0=B5=D0=B2=D0=B5=D1=80=D0=BD=D0=BE=D0=B5=20?= =?UTF-8?q?=D1=81=D0=BC=D0=B5=D1=89=D0=B5=D0=BD=D0=B8=D0=B5=20compressed?= =?UTF-8?q?=20size=20(+14=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20start+1?= =?UTF-8?q?8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/app.py | 2 +- site/templates/index.html | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/site/app.py b/site/app.py index 800affb..d2dd96d 100644 --- a/site/app.py +++ b/site/app.py @@ -20,7 +20,7 @@ if _sys_path_root not in sys.path: sys.path.insert(0, _sys_path_root) # Версия приложения (меняется при изменениях) -VERSION = "5.0.6" +VERSION = "5.0.7" def create_app(): diff --git a/site/templates/index.html b/site/templates/index.html index 55a4bc3..625f3d7 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -159,10 +159,12 @@ async function unzip(zb) { while (pos < buf.byteLength - 4) { const sig = dv.getUint32(pos, true); if (sig === 0x04034b50) { - pos += 26; const nl = dv.getUint16(pos, true); pos += 2; + const start = pos; // Начало local file header + pos += 26; + const nl = dv.getUint16(pos, true); pos += 2; const el = dv.getUint16(pos, true); pos += 2; const nm = new TextDecoder().decode(new Uint8Array(buf, pos, nl)); pos += nl + el; - const cs = dv.getUint32(pos - nl - el + 14, true); + const cs = dv.getUint32(start + 18, true); // compressed size at offset 18 files[nm] = new Blob([new Uint8Array(buf, pos, cs)]); pos += cs; } else break; }