diff --git a/src/routes/api/sender.ts b/src/routes/api/sender.ts index 890eefa98..22eea766d 100644 --- a/src/routes/api/sender.ts +++ b/src/routes/api/sender.ts @@ -7,7 +7,7 @@ import sanitize_attribute_name from "../../services/sanitize_attribute_name.js"; import specialNotesService from "../../services/special_notes.js"; import { Request } from 'express'; -function uploadImage(req: Request) { +async function uploadImage(req: Request) { const file = req.file; if (!file) { @@ -24,7 +24,7 @@ function uploadImage(req: Request) { return [400, "Invalid image content type."]; } - const uploadedImageType = imageType(file.buffer); + const uploadedImageType = await imageType(file.buffer); if (!uploadedImageType) { return [400, "Unable to determine image type."]; }