From f24a6ae8ad54e6fb584b4740ee1242922b1e51d3 Mon Sep 17 00:00:00 2001 From: Johan Lindh Date: Thu, 30 May 2024 12:30:07 +0200 Subject: [PATCH] use Contains() --- staticserve/servehttp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/staticserve/servehttp.go b/staticserve/servehttp.go index e125e89..d3fb9c1 100644 --- a/staticserve/servehttp.go +++ b/staticserve/servehttp.go @@ -6,6 +6,7 @@ import ( "io" "net/http" "strconv" + "strings" ) var headerCacheControl = []string{"public, max-age=31536000, s-maxage=31536000, immutable"} @@ -14,7 +15,7 @@ var headerContentEncoding = []string{"gzip"} func acceptsGzip(hdr http.Header) bool { for _, s := range hdr["Accept-Encoding"] { - if s == "gzip" { + if strings.Contains(s, "gzip") { return true } }