Skip to content

Commit

Permalink
fix zip bug with accept (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-singh-filestack authored Jan 30, 2024
1 parent cffaff3 commit 8842596
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,18 @@ export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Prom
} catch(e) {
console.warn("An exception occurred while processing the buffer:", e.message);
}
const excludedMimetypes = ['text/plain', 'application/octet-stream', 'application/x-ms', 'application/x-msi', 'application/zip'];

if (type && excludedMimetypes.indexOf(type.mime) === -1) {
return type.mime;
}

if (name && name.indexOf('.') > -1) {
const mime = extensionToMime(name);

if (mime) {
return mime;
}
}
const excludedMimetypes = ['text/plain', 'application/octet-stream', 'application/x-ms', 'application/x-msi', 'application/zip'];

if (type && excludedMimetypes.indexOf(type.mime) === -1) {
return type.mime;
}

try {
if (isutf8(file)) {
Expand Down

0 comments on commit 8842596

Please sign in to comment.