mirror of
https://github.com/cupcakearmy/codecrafters-http-server-go.git
synced 2024-11-09 18:34:18 +01:00
check for multiple values in header
This commit is contained in:
parent
49e5c8105d
commit
6510189400
@ -67,7 +67,7 @@ func Respond(conn net.Conn, req Request, res Response) {
|
|||||||
if res.Headers == nil {
|
if res.Headers == nil {
|
||||||
res.Headers = make(map[string]string)
|
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"
|
res.Headers["Content-Encoding"] = "gzip"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user