"net/http"
"os"
"os/exec"
- "strings"
"go.stargrave.org/tofuproxy/fifos"
)
const CmdDWebP = "dwebp"
-func isXombrero(req *http.Request) bool {
- return strings.Contains(req.Header.Get("User-Agent"), "AppleWebKit/538.15")
-}
-
func RoundTranscodeWebP(
host string,
resp *http.Response,
w http.ResponseWriter,
req *http.Request,
) (bool, error) {
- if resp.Header.Get("Content-Type") != "image/webp" || isXombrero(req) {
+ if resp.Header.Get("Content-Type") != "image/webp" {
return true, nil
}
tmpFd, err := os.CreateTemp("", "tofuproxy.*.webp")