1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

compression tweaks

This commit is contained in:
Matthias Kretschmann 2019-03-28 15:59:39 +01:00
parent df14f6bab2
commit ecd5742b22
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -39,10 +39,18 @@ const getFileCompression = async (contentType: string) => {
contentType === 'application/x-lzma' ||
contentType === 'application/x-xz' ||
contentType === 'application/x-tar' ||
contentType === 'application/x-gtar' ||
contentType === 'application/x-bzip2' ||
contentType === 'application/x-7z-compressed'
contentType === 'application/x-7z-compressed' ||
contentType === 'application/x-rar-compressed' ||
contentType === 'application/x-apple-diskimage'
) {
const contentTypeSplit = contentType.split('/')
if (contentTypeSplit[1].includes('x-')) {
return contentTypeSplit[1].replace('x-', '')
}
return contentTypeSplit[1]
} else {
return 'none'