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:
parent
99c27fa0dd
commit
e4752c8c1a
1 changed files with 3 additions and 0 deletions
|
@ -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 ""
|
||||
|
|
Loading…
Reference in a new issue