Commit ee1083d9 by Carl Bergquist Committed by Torkel Ödegaard

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

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

fixes #13079
parent db2264c5
...@@ -152,7 +152,7 @@ func downloadFile(pluginName, filePath, url string) (err error) { ...@@ -152,7 +152,7 @@ func downloadFile(pluginName, filePath, url string) (err error) {
return err return err
} }
r, err := zip.NewReader(bytes.NewReader(body), resp.ContentLength) r, err := zip.NewReader(bytes.NewReader(body), int64(len(body)))
if err != nil { if err != nil {
return err return err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment