cli: avoid rely on response.ContentLength (#13120)

response.ContentLength might be invalid if the http response
is chunked.

fixes #13079
(cherry picked from commit ee1083d9b4)
This commit is contained in:
Carl Bergquist
2018-09-03 20:33:21 +02:00
committed by Marcus Efraimsson
parent cf4c090fe2
commit c53d7ad47c
@@ -152,7 +152,7 @@ func downloadFile(pluginName, filePath, url string) (err error) {
return err
}
r, err := zip.NewReader(bytes.NewReader(body), resp.ContentLength)
r, err := zip.NewReader(bytes.NewReader(body), int64(len(body)))
if err != nil {
return err
}