mirror of
https://git.phreedom.club/localhost_frssoft/compy.git
synced 2024-11-06 00:13:20 +00:00
16 lines
333 B
Go
16 lines
333 B
Go
package transcoder
|
|
|
|
import (
|
|
"net/http"
|
|
"strings"
|
|
)
|
|
|
|
func SupportsWebP(headers http.Header) bool {
|
|
for _, v := range strings.Split(headers.Get("Accept"), ",") {
|
|
if strings.SplitN(v, ";", 2)[0] == "image/webp" || strings.SplitN(v, ";", 2)[0] == "*/*" || strings.SplitN(v, ";", 2)[0] == "" {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|