Displaying 7z/rar preview when user previews those archives.
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Controller Tests / controller-tests (push) Has been cancelled
Jest Tests / jest-tests (push) Has been cancelled

This commit is contained in:
Roland 2026-03-31 12:34:42 -06:00
parent 1e2e59ec2e
commit 0a5fe7eebe
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680

View file

@ -1144,6 +1144,10 @@ export function isSupportedArchive(mimetype, lowerPath) {
if (mimetype.startsWith('application/x-tar')) return true;
// Suffix-based detection for tar variants whose mimetype may be the compression type.
if (lowerPath.endsWith('.tar') || lowerPath.endsWith('.tar.gz') || lowerPath.endsWith('.tgz') || lowerPath.endsWith('.tar.bz2') || lowerPath.endsWith('.tar.xz')) return true;
// 7z and RAR archives.
if (mimetype.startsWith('application/x-7z-compressed')) return true;
if (mimetype.startsWith('application/x-rar') || mimetype.startsWith('application/vnd.rar')) return true;
if (lowerPath.endsWith('.7z') || lowerPath.endsWith('.rar')) return true;
return false;
}