1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Add check that the request is good

This commit is contained in:
Victor Vieux 2013-07-30 16:39:35 +00:00
parent 99c27fa0dd
commit e4752c8c1a

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 ""