Skip to content

Commit

Permalink
use Contains()
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdata committed May 30, 2024
1 parent 52ca4bb commit f24a6ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion staticserve/servehttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"net/http"
"strconv"
"strings"
)

var headerCacheControl = []string{"public, max-age=31536000, s-maxage=31536000, immutable"}
Expand All @@ -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
}
}
Expand Down

0 comments on commit f24a6ae

Please sign in to comment.