This commit is contained in:
Jiajun Huang
2019-05-31 15:56:05 +08:00
parent 75383a95b3
commit 2d24879fa3
3 changed files with 18 additions and 2 deletions

View File

@ -29,10 +29,10 @@ func GetProxyStatus(statusAddr string, user string, passwd string, name string)
if err != nil {
return status, err
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
return status, fmt.Errorf("admin api status code [%d]", resp.StatusCode)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return status, err