Fixed 267U.pre2
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { createTemp } from "./create-temp.js";
|
||||
import { downloadUrl } from "./download-url.js";
|
||||
import { detectType } from "./get-file-info.js";
|
||||
export async function detectUrlMime(url) {
|
||||
const [path, cleanup] = await createTemp();
|
||||
try {
|
||||
await downloadUrl(url, path);
|
||||
const { mime } = await detectType(path);
|
||||
return mime;
|
||||
} finally{
|
||||
cleanup();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user