From cc21908a6430ad2dedd41b3f46d16febadea5ceb Mon Sep 17 00:00:00 2001 From: chen Date: Thu, 7 Dec 2023 12:37:00 +0800 Subject: [PATCH] fix typo --- cmd/client/general/request.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/client/general/request.go b/cmd/client/general/request.go index 647119c6af..0d596b0993 100644 --- a/cmd/client/general/request.go +++ b/cmd/client/general/request.go @@ -148,11 +148,10 @@ func HandleReqWithStreamResp(httpMethod string, path string, yamlBody []byte) (i if strings.HasPrefix(url, HTTPProtocol) && resp.StatusCode == http.StatusBadRequest { body, err := io.ReadAll(resp.Body) + resp.Body.Close() if err != nil { - resp.Body.Close() return nil, fmt.Errorf("read response body failed: %v", err) } - resp.Body.Close() // https://github.com/golang/go/blob/release-branch.go1.20/src/net/http/server.go#L1878-L1885 if strings.Contains(string(body), "Client sent an HTTP request to an HTTPS server") {