Commit 5d50dbc5 authored by Alex Brainman's avatar Alex Brainman

net/http: use r.Body.Close to close connection during TestServeFileFromCWD

Fixes #3917.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6553061
parent 659d1df1
......@@ -340,11 +340,6 @@ func TestServeFileMimeType(t *testing.T) {
}
func TestServeFileFromCWD(t *testing.T) {
if runtime.GOOS == "windows" {
// TODO(brainman): find out why this test is broken
t.Logf("Temporarily skipping test on Windows; see http://golang.org/issue/3917")
return
}
ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) {
ServeFile(w, r, "fs_test.go")
}))
......@@ -353,6 +348,7 @@ func TestServeFileFromCWD(t *testing.T) {
if err != nil {
t.Fatal(err)
}
r.Body.Close()
if r.StatusCode != 200 {
t.Fatalf("expected 200 OK, got %s", r.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