We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85b6d18 commit e2df878Copy full SHA for e2df878
packages/uikit-utils/src/shared/file.ts
@@ -195,8 +195,9 @@ export function getFileExtension(filePath: string) {
195
else return result;
196
}
197
198
-export function getFileExtensionFromUri(uri: string) {
199
- return fetch(uri).then((response) => response.headers.get('content-type'));
+export async function getFileExtensionFromUri(uri: string) {
+ const type = await fetch(uri).then((response) => response.headers.get('content-type'));
200
+ return getFileExtensionFromMime(type);
201
202
203
export function isImage(filePath: string, mimeType?: string) {
0 commit comments