webp everywhere if possible (clients may be confused...)

This commit is contained in:
localhost_frssoft 2023-01-07 02:51:41 +03:00
parent ac99d6b3a8
commit 59c6349ced

View file

@ -7,7 +7,7 @@ import (
func SupportsWebP(headers http.Header) bool {
for _, v := range strings.Split(headers.Get("Accept"), ",") {
if strings.SplitN(v, ";", 2)[0] == "image/webp" {
if strings.SplitN(v, ";", 2)[0] == "image/webp" || strings.SplitN(v, ";", 2)[0] == "*/*" || strings.SplitN(v, ";", 2)[0] == "" {
return true
}
}