Skip to content

Commit

Permalink
skip catch
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-singh-filestack committed Jan 5, 2024
1 parent af3863d commit 2bab115
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/lib/api/upload/file_tools.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ export const getFile = (input: InputFile, sanitizeOptions?: SanitizeOptions): Pr
async res => {
let mime = file.type;
let minimumBytes = 4100;
console.log("just for fun")
if (!file.type || file.type.length === 0 || file.type === 'text/plain') {
mime = await getMimetype(await res.slice(0, minimumBytes), filename);
}
Expand Down
9 changes: 5 additions & 4 deletions src/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Prom
try {
type = await fromBuffer(file);
} catch(e) {
const mime = extensionToMime(name);
if (mime) {
return mime;
}
// const mime = extensionToMime(name);
// if (mime) {
// return mime;
// }
console.log("catching")
}
const excludedMimetypes = ['text/plain', 'application/octet-stream', 'application/x-ms', 'application/x-msi', 'application/zip'];

Expand Down

0 comments on commit 2bab115

Please sign in to comment.