1
0
mirror of https://github.com/docker/cli.git synced 2026-01-18 08:21:31 +03:00

Add check that the request is good

Upstream-commit: e4752c8c1a09fc3cc96dbb9be7183b271db3d6b7
Component: engine
This commit is contained in:
Victor Vieux
2013-07-30 16:39:35 +00:00
parent ccc9b252b2
commit c7d245ec6d

View File

@@ -736,6 +736,9 @@ func GetReleaseVersion() string {
return ""
}
defer resp.Body.Close()
if resp.ContentLength > 24 || resp.StatusCode != 200 {
return ""
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return ""