fix: use file-type for mime sniffing

This commit is contained in:
Peter Steinberger
2025-12-20 19:13:50 +01:00
parent 1356498ee1
commit 36c85a617a
14 changed files with 5291 additions and 91 deletions

View File

@@ -332,7 +332,7 @@ export async function createCanvasHostHandler(
const mime =
lower.endsWith(".html") || lower.endsWith(".htm")
? "text/html"
: (detectMime({ filePath }) ?? "application/octet-stream");
: ((await detectMime({ filePath })) ?? "application/octet-stream");
res.setHeader("Cache-Control", "no-store");
if (mime === "text/html") {