From d10ab13c18e1c7ec990a7878a6d1a0dadb089f90 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 25 Jul 2018 18:08:16 +0000 Subject: [PATCH] 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 --- src/net/http/serve_test.go | 3 +++ 1 file changed, 3 insertions(+) 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: -- 2.50.0