Body should be empty.

This commit is contained in:
Mitar 2022-04-07 11:08:39 +02:00
parent 71078dcc12
commit 21744b96bd
1 changed files with 7 additions and 0 deletions

View File

@ -595,7 +595,14 @@ func testServeFileNotModified(t *testing.T, h2 bool) {
if err != nil {
t.Fatal(err)
}
b, err := io.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
t.Fatal("reading Body:", err)
}
if len(b) != 0 {
t.Errorf("non-empty body")
}
if g, e := resp.StatusCode, StatusNotModified; g != e {
t.Errorf("status mismatch: got %d, want %d", g, e)
}