mirror of https://github.com/docker/docs.git
Add check that the request is good
This commit is contained in:
parent
99c27fa0dd
commit
e4752c8c1a
|
@ -736,6 +736,9 @@ func GetReleaseVersion() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
if resp.ContentLength > 24 || resp.StatusCode != 200 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ""
|
return ""
|
||||||
|
|
Loading…
Reference in New Issue