From: Andrew Bonventre Date: Sat, 20 Jan 2018 02:43:13 +0000 (-0500) Subject: [release-branch.go1.9] net/http: update bundled http2 X-Git-Tag: go1.9.3~4 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5380990b844500d32646f38c5735c86d6b0dc96c;p=gostls13.git [release-branch.go1.9] net/http: update bundled http2 Updates http2 to x/net/http2 git rev 44b7c21 for http2: Discard data reads on HEAD requests https://golang.org/cl/88655 Fixes golang/go#22376 Change-Id: I931d9065d7309bc6d3f978bfe8cc6a9f940ce9e9 Reviewed-on: https://go-review.googlesource.com/88676 Run-TryBot: Andrew Bonventre TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go index 83f1671a5d..2c78b2270c 100644 --- a/src/net/http/h2_bundle.go +++ b/src/net/http/h2_bundle.go @@ -8222,6 +8222,14 @@ func (rl *http2clientConnReadLoop) processData(f *http2DataFrame) error { return nil } if f.Length > 0 { + if cs.req.Method == "HEAD" && len(data) > 0 { + cc.logf("protocol error: received DATA on a HEAD request") + rl.endStreamError(cs, http2StreamError{ + StreamID: f.StreamID, + Code: http2ErrCodeProtocol, + }) + return nil + } // Check connection-level flow control. cc.mu.Lock() if cs.inflow.available() >= int32(f.Length) {