diff options
author | Wim <wim@42.be> | 2020-12-06 23:16:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-06 23:16:02 +0100 |
commit | 0d7315249d20bf9856605068074a7b6c6bcce835 (patch) | |
tree | f8ab7e0f3e96491e439eb49beebf3fae658215c4 /vendor/golang.org/x/net | |
parent | 4913766d58cd1fe204b27dc93172c5dd4a95a88a (diff) | |
download | matterbridge-msglm-0d7315249d20bf9856605068074a7b6c6bcce835.tar.gz matterbridge-msglm-0d7315249d20bf9856605068074a7b6c6bcce835.tar.bz2 matterbridge-msglm-0d7315249d20bf9856605068074a7b6c6bcce835.zip |
Update vendor (#1330)
Diffstat (limited to 'vendor/golang.org/x/net')
-rw-r--r-- | vendor/golang.org/x/net/http2/server.go | 11 | ||||
-rw-r--r-- | vendor/golang.org/x/net/http2/transport.go | 4 |
2 files changed, 9 insertions, 6 deletions
diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index 345b7cd8..02714ade 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -2020,7 +2020,11 @@ func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*res } if bodyOpen { if vv, ok := rp.header["Content-Length"]; ok { - req.ContentLength, _ = strconv.ParseInt(vv[0], 10, 64) + if cl, err := strconv.ParseUint(vv[0], 10, 63); err == nil { + req.ContentLength = int64(cl) + } else { + req.ContentLength = 0 + } } else { req.ContentLength = -1 } @@ -2403,9 +2407,8 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { var ctype, clen string if clen = rws.snapHeader.Get("Content-Length"); clen != "" { rws.snapHeader.Del("Content-Length") - clen64, err := strconv.ParseInt(clen, 10, 64) - if err == nil && clen64 >= 0 { - rws.sentContentLen = clen64 + if cl, err := strconv.ParseUint(clen, 10, 63); err == nil { + rws.sentContentLen = int64(cl) } else { clen = "" } diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 2482f7bf..4ec32669 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -2006,8 +2006,8 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra if !streamEnded || isHead { res.ContentLength = -1 if clens := res.Header["Content-Length"]; len(clens) == 1 { - if clen64, err := strconv.ParseInt(clens[0], 10, 64); err == nil { - res.ContentLength = clen64 + if cl, err := strconv.ParseUint(clens[0], 10, 63); err == nil { + res.ContentLength = int64(cl) } else { // TODO: care? unlike http/1, it won't mess up our framing, so it's // more safe smuggling-wise to ignore. |