diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-02-09 08:19:58 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-02-09 08:19:58 +0000 |
commit | 94252f4bcc0a3f487b804ce535cb77b8bef4db83 (patch) | |
tree | 7ca86535c5a6b99d4cc432ba5cfddabc5ee4ea16 /libgo/go/net/http/serve_test.go | |
parent | cd6368115dbd75d9187877097c48a0d8d4c04fd4 (diff) |
libgo: Update to weekly.2012-02-07.
From-SVN: r184034
Diffstat (limited to 'libgo/go/net/http/serve_test.go')
-rw-r--r-- | libgo/go/net/http/serve_test.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libgo/go/net/http/serve_test.go b/libgo/go/net/http/serve_test.go index 147c216ec78..e2860c3edcf 100644 --- a/libgo/go/net/http/serve_test.go +++ b/libgo/go/net/http/serve_test.go @@ -504,8 +504,9 @@ func Test304Responses(t *testing.T) { } // TestHeadResponses verifies that responses to HEAD requests don't -// declare that they're chunking in their response headers and aren't -// allowed to produce output. +// declare that they're chunking in their response headers, aren't +// allowed to produce output, and don't set a Content-Type since +// the real type of the body data cannot be inferred. func TestHeadResponses(t *testing.T) { ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) { _, err := w.Write([]byte("Ignored body")) @@ -527,6 +528,10 @@ func TestHeadResponses(t *testing.T) { if len(res.TransferEncoding) > 0 { t.Errorf("expected no TransferEncoding; got %v", res.TransferEncoding) } + ct := res.Header.Get("Content-Type") + if ct != "" { + t.Errorf("expected no Content-Type; got %s", ct) + } body, err := ioutil.ReadAll(res.Body) if err != nil { t.Error(err) |