Explorar o código

Add check that the request is good

Victor Vieux %!s(int64=12) %!d(string=hai) anos
pai
achega
e4752c8c1a
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      utils/utils.go

+ 3 - 0
utils/utils.go

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