From 9c35fa4a0a5772d61cfb3c069589f86abe054e54 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:50:56 -0400 Subject: [PATCH] Remove support for non-gif images --- app/routes/report.tsx | 7 ------- functions/api/reports/submit.ts | 18 +++--------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/app/routes/report.tsx b/app/routes/report.tsx index bb6d231..248e8df 100644 --- a/app/routes/report.tsx +++ b/app/routes/report.tsx @@ -44,17 +44,10 @@ export default function () { const [uploading, setUploading] = useState(false); const fileTypes: { [k: string]: string } = { gif: "image/gif", - heic: "image/heic", - heif: "image/heif", - jfif: "image/jpeg", - jpeg: "image/jpeg", - jpg: "image/jpg", m4v: "video/x-m4v", mkv: "video/x-matroska", mov: "video/mp4", mp4: "video/mp4", - png: "image/png", - webp: "image/webp", webm: "video/webm", wmv: "video/x-ms-wmv", }; diff --git a/functions/api/reports/submit.ts b/functions/api/reports/submit.ts index b66e6e3..04dbdad 100644 --- a/functions/api/reports/submit.ts +++ b/functions/api/reports/submit.ts @@ -138,21 +138,9 @@ export async function onRequestPost(context: RequestContext) { if ( fileParts.length < 2 || - ![ - "mkv", - "mp4", - "wmv", - "jpg", - "png", - "m4v", - "jpeg", - "jfif", - "gif", - "webm", - "heif", - "heic", - "webp", - ].includes(fileExten.toLowerCase()) + !["mkv", "mp4", "wmv", "m4v", "gif", "webm"].includes( + fileExten.toLowerCase(), + ) ) return jsonError( `File ${file.name} cannot be uploaded as it is unsupported`,