From fd8750e9595f40101e7b75791e9b4859aaf5525b Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Fri, 4 Nov 2022 23:22:38 +0800 Subject: [PATCH] fix: http body must be drained in downloadBinary() (#16001) --- cmd/update.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/update.go b/cmd/update.go index 14d4f0005..650806bf2 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -495,7 +495,7 @@ func downloadBinary(u *url.URL, mode string) (readerReturn []byte, err error) { } else { return nil, fmt.Errorf("unsupported protocol scheme: %s", u.Scheme) } - + defer xhttp.DrainBody(reader) // convert a Reader to bytes binaryFile, err := io.ReadAll(reader) if err != nil {