fix: images proxy handler now handle all image types

This commit is contained in:
rramiachraf 2024-05-30 18:40:19 +01:00
parent 8241deac12
commit 0381b6e4ae

View File

@ -14,11 +14,14 @@ import (
) )
func isValidExt(ext string) bool { func isValidExt(ext string) bool {
valid := []string{"jpg", "jpeg", "png", "gif"} extType := mime.TypeByExtension("." + strings.ToLower(ext))
for _, c := range valid { isImage, _, found := strings.Cut(extType, "/")
if strings.ToLower(ext) == c { if !found {
return true return false
} }
if isImage == "image" {
return true
} }
return false return false