summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/net/http2/server.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-12-06 23:16:02 +0100
committerGitHub <noreply@github.com>2020-12-06 23:16:02 +0100
commit0d7315249d20bf9856605068074a7b6c6bcce835 (patch)
treef8ab7e0f3e96491e439eb49beebf3fae658215c4 /vendor/golang.org/x/net/http2/server.go
parent4913766d58cd1fe204b27dc93172c5dd4a95a88a (diff)
downloadmatterbridge-msglm-0d7315249d20bf9856605068074a7b6c6bcce835.tar.gz
matterbridge-msglm-0d7315249d20bf9856605068074a7b6c6bcce835.tar.bz2
matterbridge-msglm-0d7315249d20bf9856605068074a7b6c6bcce835.zip
Update vendor (#1330)
Diffstat (limited to 'vendor/golang.org/x/net/http2/server.go')
-rw-r--r--vendor/golang.org/x/net/http2/server.go11
1 files changed, 7 insertions, 4 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 = ""
}