integration: TestCacheControl and TestHSTS close the ResponseBody

This commit is contained in:
Lukasz Szaszkiewicz 2022-08-17 10:52:12 +02:00
parent 619f1cf552
commit be2c707a4c

View File

@ -246,6 +246,7 @@ func TestCacheControl(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer resp.Body.Close()
cc := resp.Header.Get("Cache-Control")
if !strings.Contains(cc, "private") {
t.Errorf("expected private cache-control, got %q", cc)
@ -291,6 +292,7 @@ func TestHSTS(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer resp.Body.Close()
cc := resp.Header.Get("Strict-Transport-Security")
if !strings.Contains(cc, "max-age=31536000; includeSubDomains") {
t.Errorf("expected max-age=31536000; includeSubDomains, got %q", cc)