]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.9] net/http: update bundled http2
authorAndrew Bonventre <andybons@golang.org>
Sat, 20 Jan 2018 02:43:13 +0000 (21:43 -0500)
committerAndrew Bonventre <andybons@golang.org>
Mon, 22 Jan 2018 20:25:14 +0000 (20:25 +0000)
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>
src/net/http/h2_bundle.go

index 83f1671a5d08d6a4664494de5b7b34cd73f14c2b..2c78b2270ceb862d06f1fd76f52bf6f40787f853 100644 (file)
@@ -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) {