From 7bca25bd2ca494faae6d7e396d32d1d8c614fa95 Mon Sep 17 00:00:00 2001 From: nyne Date: Sun, 18 May 2025 17:32:24 +0800 Subject: [PATCH] Add support for BMP image format in content type validation --- server/service/image.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/service/image.go b/server/service/image.go index 437b8fb..15caad3 100644 --- a/server/service/image.go +++ b/server/service/image.go @@ -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") }