Jelajahi Sumber

Add check that the request is good

Victor Vieux 12 tahun lalu
induk
melakukan
e4752c8c1a
1 mengubah file dengan 3 tambahan dan 0 penghapusan
  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 ""