Remove support for non-gif images
This commit is contained in:
parent
44ee965c60
commit
9c35fa4a0a
@ -44,17 +44,10 @@ export default function () {
|
|||||||
const [uploading, setUploading] = useState(false);
|
const [uploading, setUploading] = useState(false);
|
||||||
const fileTypes: { [k: string]: string } = {
|
const fileTypes: { [k: string]: string } = {
|
||||||
gif: "image/gif",
|
gif: "image/gif",
|
||||||
heic: "image/heic",
|
|
||||||
heif: "image/heif",
|
|
||||||
jfif: "image/jpeg",
|
|
||||||
jpeg: "image/jpeg",
|
|
||||||
jpg: "image/jpg",
|
|
||||||
m4v: "video/x-m4v",
|
m4v: "video/x-m4v",
|
||||||
mkv: "video/x-matroska",
|
mkv: "video/x-matroska",
|
||||||
mov: "video/mp4",
|
mov: "video/mp4",
|
||||||
mp4: "video/mp4",
|
mp4: "video/mp4",
|
||||||
png: "image/png",
|
|
||||||
webp: "image/webp",
|
|
||||||
webm: "video/webm",
|
webm: "video/webm",
|
||||||
wmv: "video/x-ms-wmv",
|
wmv: "video/x-ms-wmv",
|
||||||
};
|
};
|
||||||
|
@ -138,21 +138,9 @@ export async function onRequestPost(context: RequestContext) {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
fileParts.length < 2 ||
|
fileParts.length < 2 ||
|
||||||
![
|
!["mkv", "mp4", "wmv", "m4v", "gif", "webm"].includes(
|
||||||
"mkv",
|
fileExten.toLowerCase(),
|
||||||
"mp4",
|
)
|
||||||
"wmv",
|
|
||||||
"jpg",
|
|
||||||
"png",
|
|
||||||
"m4v",
|
|
||||||
"jpeg",
|
|
||||||
"jfif",
|
|
||||||
"gif",
|
|
||||||
"webm",
|
|
||||||
"heif",
|
|
||||||
"heic",
|
|
||||||
"webp",
|
|
||||||
].includes(fileExten.toLowerCase())
|
|
||||||
)
|
)
|
||||||
return jsonError(
|
return jsonError(
|
||||||
`File ${file.name} cannot be uploaded as it is unsupported`,
|
`File ${file.name} cannot be uploaded as it is unsupported`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user