]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: expand a TimeoutHandler test a bit
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 25 Jul 2018 18:08:16 +0000 (18:08 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 31 Jul 2018 15:07:39 +0000 (15:07 +0000)
Updates #22821

Change-Id: I2d0d483538174a90f56c26d99bea89fe9ce4d144
Reviewed-on: https://go-review.googlesource.com/125855
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
src/net/http/serve_test.go

index 13057452b4703dab3851a85f0937857351e24521..b53c2f856bcaff1824bd0c66008725fea40b12d6 100644 (file)
@@ -2324,6 +2324,9 @@ func testTimeoutHandler(t *testing.T, h2 bool) {
        if !strings.Contains(string(body), "<title>Timeout</title>") {
                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: