Skip to content

Commit 8842596

Browse files
fix zip bug with accept (#548)
1 parent cffaff3 commit 8842596

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/lib/utils/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,18 @@ export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Prom
108108
} catch(e) {
109109
console.warn("An exception occurred while processing the buffer:", e.message);
110110
}
111-
const excludedMimetypes = ['text/plain', 'application/octet-stream', 'application/x-ms', 'application/x-msi', 'application/zip'];
112-
113-
if (type && excludedMimetypes.indexOf(type.mime) === -1) {
114-
return type.mime;
115-
}
116-
117111
if (name && name.indexOf('.') > -1) {
118112
const mime = extensionToMime(name);
119113

120114
if (mime) {
121115
return mime;
122116
}
123117
}
118+
const excludedMimetypes = ['text/plain', 'application/octet-stream', 'application/x-ms', 'application/x-msi', 'application/zip'];
119+
120+
if (type && excludedMimetypes.indexOf(type.mime) === -1) {
121+
return type.mime;
122+
}
124123

125124
try {
126125
if (isutf8(file)) {

0 commit comments

Comments
 (0)