mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +00:00
Add support for BMP image format in content type validation
This commit is contained in:
@@ -71,7 +71,7 @@ func CreateImage(uid uint, data []byte) (uint, error) {
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user