refactor: remove strict MIME-type allowlist check from validateImageFile
This commit is contained in:
@@ -28,9 +28,6 @@ const fileToBase64 = (file: File): Promise<string> =>
|
|||||||
});
|
});
|
||||||
|
|
||||||
const validateImageFile = (file: File): string | null => {
|
const validateImageFile = (file: File): string | null => {
|
||||||
if (!IMAGE_MIME_TYPES.includes(file.type)) {
|
|
||||||
return "Only PNG, JPEG, and WebP images are supported.";
|
|
||||||
}
|
|
||||||
if (file.size > MAX_IMAGE_SIZE_BYTES) {
|
if (file.size > MAX_IMAGE_SIZE_BYTES) {
|
||||||
return "Image must be less than 10MB.";
|
return "Image must be less than 10MB.";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user