aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bonventre <andybons@golang.org>2018-01-19 21:43:13 -0500
committerAndrew Bonventre <andybons@golang.org>2018-01-22 20:25:14 +0000
commit5380990b844500d32646f38c5735c86d6b0dc96c (patch)
tree9723d6dc67f3c933a764d316be39aba0f4d624ac
parentedd3537817d257f35668a6c88f266ad76546fbd2 (diff)
downloadgo-5380990b844500d32646f38c5735c86d6b0dc96c.tar.gz
go-5380990b844500d32646f38c5735c86d6b0dc96c.zip
[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 <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r--src/net/http/h2_bundle.go8
1 files changed, 8 insertions, 0 deletions
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) {