Skip to content

Commit df385ce

Browse files
committed
Add additional mimetypes to check if a file is an archive
1 parent b6e3109 commit df385ce

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

resources/scripts/api/transformers.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,17 @@ export const rawDataToFileObject = (data: FractalResponseData): FileObject => ({
2626

2727
isArchiveType: function () {
2828
return this.isFile && [
29-
'application/zip',
30-
'application/gzip',
31-
'application/x-tar',
29+
'application/vnd.rar', // .rar
30+
'application/x-rar-compressed', // .rar (2)
31+
'application/x-tar', // .tar
32+
'application/x-br', // .tar.br
33+
'application/x-bzip2', // .tar.bz2, .bz2
34+
'application/gzip', // .tar.gz, .gz
35+
'application/x-lzip', // .tar.lz4, .lz4 (not sure if this mime type is correct)
36+
'application/x-sz', // .tar.sz, .sz (not sure if this mime type is correct)
37+
'application/x-xz', // .tar.xz, .xz
38+
'application/zstd', // .tar.zst, .zst
39+
'application/zip', // .zip
3240
].indexOf(this.mimetype) >= 0;
3341
},
3442
});

0 commit comments

Comments
 (0)