Commit 77c041cc authored by Tom Bergan's avatar Tom Bergan

net/http: update bundled http2

Updates http2 to x/net/http2 git rev 1087133bc4a for:

  http2: reject DATA frame before HEADERS frame
  https://golang.org/cl/56770

  http2: respect peer's SETTINGS_MAX_HEADER_LIST_SIZE in ClientConn
  https://golang.org/cl/29243

  http2: reset client stream after processing response headers
  https://golang.org/cl/70510

Also updated TestRequestLimit_h2 as the behavior changed slightly due
to https://golang.org/cl/29243.

Fixes #13959
Fixes #20521
Fixes #21466

Change-Id: Iac659694f3a48b8bd485546a4f96a932e3056026
Reviewed-on: https://go-review.googlesource.com/71611
Run-TryBot: Tom Bergan <tombergan@google.com>
Reviewed-by: 's avatarJoe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 48754592
This diff is collapsed.
......@@ -2765,15 +2765,28 @@ func testRequestLimit(t *testing.T, h2 bool) {
req.Header.Set(fmt.Sprintf("header%05d", i), fmt.Sprintf("val%05d", i))
}
res, err := cst.c.Do(req)
if err != nil {
if res != nil {
defer res.Body.Close()
}
if h2 {
// In HTTP/2, the result depends on a race. If the client has received the
// server's SETTINGS before RoundTrip starts sending the request, then RoundTrip
// will fail with an error. Otherwise, the client should receive a 431 from the
// server.
if err == nil && res.StatusCode != 431 {
t.Fatalf("expected 431 response status; got: %d %s", res.StatusCode, res.Status)
}
} else {
// In HTTP/1, we expect a 431 from the server.
// Some HTTP clients may fail on this undefined behavior (server replying and
// closing the connection while the request is still being written), but
// we do support it (at least currently), so we expect a response below.
t.Fatalf("Do: %v", err)
}
defer res.Body.Close()
if res.StatusCode != 431 {
t.Fatalf("expected 431 response status; got: %d %s", res.StatusCode, res.Status)
if err != nil {
t.Fatalf("Do: %v", err)
}
if res.StatusCode != 431 {
t.Fatalf("expected 431 response status; got: %d %s", res.StatusCode, res.Status)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment