From 5380990b844500d32646f38c5735c86d6b0dc96c Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Fri, 19 Jan 2018 21:43:13 -0500 Subject: [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 --- src/net/http/h2_bundle.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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) { -- cgit v1.2.3-54-g00ecf