Skip to content

Commit b3b0d48

Browse files
[12179] Fixed import fileType buffer method issue (#595)
* update file-type package version to latest for correct mimetype detection * revert package.lock json changes * change fileType buffer method
1 parent fcf8367 commit b3b0d48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/utils/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import { Session } from '../client';
1919
import { Hosts } from './../../config';
2020
import { ExtensionsMap } from './extensions';
21-
import { fromBuffer } from 'file-type';
21+
import FileType from 'file-type';
2222
import isutf8 from 'isutf8';
2323

2424
/**
@@ -105,7 +105,7 @@ export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Prom
105105
let type;
106106

107107
try {
108-
type = await fromBuffer(file);
108+
type = await FileType.fileTypeFromBuffer(file);
109109
} catch(e) {
110110
console.warn("An exception occurred while processing the buffer:", e.message);
111111
}

0 commit comments

Comments
 (0)