fix: images proxy handler now handle all image types
This commit is contained in:
parent
8241deac12
commit
0381b6e4ae
@ -14,11 +14,14 @@ import (
|
||||
)
|
||||
|
||||
func isValidExt(ext string) bool {
|
||||
valid := []string{"jpg", "jpeg", "png", "gif"}
|
||||
for _, c := range valid {
|
||||
if strings.ToLower(ext) == c {
|
||||
return true
|
||||
extType := mime.TypeByExtension("." + strings.ToLower(ext))
|
||||
isImage, _, found := strings.Cut(extType, "/")
|
||||
if !found {
|
||||
return false
|
||||
}
|
||||
|
||||
if isImage == "image" {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
|
Loading…
x
Reference in New Issue
Block a user