From: Brad Fitzpatrick Date: Wed, 25 Jul 2018 18:08:16 +0000 (+0000) Subject: net/http: expand a TimeoutHandler test a bit X-Git-Tag: go1.11beta3~53 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d10ab13c18e1c7ec990a7878a6d1a0dadb089f90;p=gostls13.git net/http: expand a TimeoutHandler test a bit Updates #22821 Change-Id: I2d0d483538174a90f56c26d99bea89fe9ce4d144 Reviewed-on: https://go-review.googlesource.com/125855 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Andrew Bonventre --- diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go index 13057452b4..b53c2f856b 100644 --- a/src/net/http/serve_test.go +++ b/src/net/http/serve_test.go @@ -2324,6 +2324,9 @@ func testTimeoutHandler(t *testing.T, h2 bool) { if !strings.Contains(string(body), "Timeout") { t.Errorf("expected timeout body; got %q", string(body)) } + if g, w := res.Header.Get("Content-Type"), "text/html; charset=utf-8"; g != w { + t.Errorf("response content-type = %q; want %q", g, w) + } // Now make the previously-timed out handler speak again, // which verifies the panic is handled: