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 {
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user