check for multiple values in header

This commit is contained in:
Niccolo Borgioli 2024-05-26 01:11:15 +02:00
parent 49e5c8105d
commit 6510189400
No known key found for this signature in database
GPG Key ID: 4897ACD13A65977C

View File

@ -67,7 +67,7 @@ func Respond(conn net.Conn, req Request, res Response) {
if res.Headers == nil {
res.Headers = make(map[string]string)
}
if req.Headers["Accept-Encoding"] == "gzip" {
if strings.Contains(req.Headers["Accept-Encoding"], "gzip") {
res.Headers["Content-Encoding"] = "gzip"
}