refactor: Upgrade to mime 4.0.4 (#9363)

This commit is contained in:
Antoine Cormouls
2024-10-23 20:03:48 +02:00
committed by GitHub
parent 412e72463e
commit 3a9442a42f
5 changed files with 36 additions and 58 deletions

View File

@@ -3,7 +3,6 @@ import { randomHexString } from '../cryptoUtils';
import AdaptableController from './AdaptableController';
import { validateFilename, FilesAdapter } from '../Adapters/Files/FilesAdapter';
import path from 'path';
import mime from 'mime';
const Parse = require('parse').Parse;
const legacyFilesRegex = new RegExp(
@@ -19,7 +18,7 @@ export class FilesController extends AdaptableController {
const extname = path.extname(filename);
const hasExtension = extname.length > 0;
const mime = (await import('mime')).default
if (!hasExtension && contentType && mime.getExtension(contentType)) {
filename = filename + '.' + mime.getExtension(contentType);
} else if (hasExtension && !contentType) {