Add support for BMP image format in content type validation

This commit is contained in:
2025-05-18 17:32:24 +08:00
parent db34b32d63
commit 7bca25bd2c

View File

@@ -71,7 +71,7 @@ func CreateImage(uid uint, data []byte) (uint, error) {
} }
contentType := http.DetectContentType(data) contentType := http.DetectContentType(data)
if contentType != "image/jpeg" && contentType != "image/png" && contentType != "image/gif" && contentType != "image/webp" { if contentType != "image/jpeg" && contentType != "image/png" && contentType != "image/gif" && contentType != "image/webp" && contentType != "image/bmp" {
return 0, model.NewRequestError("Invalid image format") return 0, model.NewRequestError("Invalid image format")
} }