Merge pull request #111885 from p0lyn0mial/apiserver-integration-rsp-body

integration: TestCacheControl and TestHSTS close the ResponseBody
This commit is contained in:
Kubernetes Prow Robot 2022-08-25 05:14:07 -07:00 committed by GitHub
commit 00191af94b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)