Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion backend/files/file-archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,12 @@ async function extractWithinLimit(
failure = new Error(`Extracted content exceeds maximum allowed size of ${limitMB}MB`);
return;
}
chunks.push(chunk);
fileBytes += chunk.length;
if (fileBytes > limit) {
failure = new Error(`Entry "${file.name}" exceeds maximum allowed size of ${limitMB}MB`);
return;
}
chunks.push(chunk);
if (final) {
writes.push(writeEntry(fullPath, concatChunks(chunks, fileBytes)));
entryCount++;
Expand Down
Loading