fix(import): MP4 videos not recognized due to upstream bug

This commit is contained in:
Elian Doran 2025-05-03 01:59:29 +03:00
parent dc8a0c6fff
commit abede6239d
No known key found for this signature in database
2 changed files with 7 additions and 1 deletions

View File

@ -45,6 +45,11 @@ describe("#getMime", () => {
["test.zip"], "application/zip" ["test.zip"], "application/zip"
], ],
[
"MP4 videos are supported",
["video.mp4"], "video/mp4"
],
[ [
"unknown MIME type not recognized by mimeTypes.lookup", "unknown MIME type not recognized by mimeTypes.lookup",
["test.fake"], false ["test.fake"], false

View File

@ -71,7 +71,8 @@ const EXTENSION_TO_MIME = new Map<string, string>([
[".ts", "text/x-typescript"], [".ts", "text/x-typescript"],
[".excalidraw", "application/json"], [".excalidraw", "application/json"],
[".mermaid", "text/vnd.mermaid"], [".mermaid", "text/vnd.mermaid"],
[".mmd", "text/vnd.mermaid"] [".mmd", "text/vnd.mermaid"],
[".mp4", "video/mp4"] // https://github.com/jshttp/mime-types/issues/138
]); ]);
/** @returns false if MIME is not detected */ /** @returns false if MIME is not detected */