Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove support for non-gif images
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 44ee965 commit 9c35fa4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
7 changes: 0 additions & 7 deletions app/routes/report.tsx
Expand Up @@ -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",
};
Expand Down
18 changes: 3 additions & 15 deletions functions/api/reports/submit.ts
Expand Up @@ -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`,
Expand Down

0 comments on commit 9c35fa4

Please sign in to comment.