Skip to content

Commit

Permalink
chore: ensure we don't try to close a nil response body
Browse files Browse the repository at this point in the history
Signed-off-by: Kit Patella <[email protected]>
  • Loading branch information
mkcp committed Sep 30, 2024
1 parent 838e1e0 commit e23dd79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/e2e/21_connect_creds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ func TestMetrics(t *testing.T) {
client := &http.Client{Transport: tr}
httpsEndpoint := strings.ReplaceAll(tunnel.HTTPEndpoint(), "http", "https")
resp, err := client.Get(httpsEndpoint + "/metrics")
defer func() {
require.NoError(t, resp.Body.Close())
}()
if err != nil {
t.Fatal(err)
}
defer func() {
require.NoError(t, resp.Body.Close())
}()

// Read the response body
body, err := io.ReadAll(resp.Body)
Expand Down

0 comments on commit e23dd79

Please sign in to comment.