diff --git a/pkgs/api/_finfo.ts b/pkgs/api/_finfo.ts index ec55ad9..cd72568 100644 --- a/pkgs/api/_finfo.ts +++ b/pkgs/api/_finfo.ts @@ -21,9 +21,9 @@ export const _ = { if (await file.exists()) { const arr = (path.split("/").pop() || "").split("-"); - const ext = arr.pop(); + const ctype = mime.getType(path); + const ext = mime.getExtension(ctype || ""); const fname = arr.join("-") + "." + ext; - const ctype = mime.getType(fname); res = new Response( JSON.stringify({