Add check that the request is good

This commit is contained in:
Victor Vieux 2013-07-30 16:39:35 +00:00
Родитель 99c27fa0dd
Коммит e4752c8c1a
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

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