Add check that the request is good

This commit is contained in:
Victor Vieux
2013-07-30 16:42:32 +00:00
parent 99c27fa0dd
commit e4752c8c1a
+3
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 ""