From b35aab6d61828ef9502abca98384dd9b59f95ffd Mon Sep 17 00:00:00 2001 From: sago35 Date: Tue, 10 Aug 2021 21:46:16 +0900 Subject: [PATCH] Add support for case-insensitive header names --- net/http/tinygo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/http/tinygo.go b/net/http/tinygo.go index d0f62c4..6d7a880 100644 --- a/net/http/tinygo.go +++ b/net/http/tinygo.go @@ -224,7 +224,7 @@ func (c *Client) doResp(conn net.Conn, req *Request) (*Response, error) { resp.Header.Add(header[0], header[1]) } - if header[0] == "Content-Length" { + if strings.ToLower(header[0]) == "content-length" { resp.ContentLength, err = strconv.ParseInt(header[1], 10, 64) if err != nil { conn.Close()