fix: http body must be drained in downloadBinary() (#16001)

This commit is contained in:
jiuker
2022-11-04 23:22:38 +08:00
committed by GitHub
parent 7be65f66b8
commit fd8750e959

View File

@@ -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 {