diff --git a/agent/http_oss_test.go b/agent/http_oss_test.go index 1d772f3376..8627a1dfda 100644 --- a/agent/http_oss_test.go +++ b/agent/http_oss_test.go @@ -60,6 +60,7 @@ func TestHTTPAPI_MethodNotAllowed_OSS(t *testing.T) { if err != nil { t.Fatal("client.Do failed: ", err) } + defer resp.Body.Close() allowed := method == "OPTIONS" for _, allowedMethod := range allowedMethods {