Close response body properly (#143)
This commit is contained in:
parent
4f467dcdde
commit
7cc03be424
|
@ -68,11 +68,10 @@ func (mc ManagerClient) makeRequest(url, token string) (string, error) {
|
|||
mgReq.Header.Set("Authorization", token)
|
||||
|
||||
res, err := hc.Do(mgReq)
|
||||
defer res.Body.Close()
|
||||
|
||||
if err != nil {
|
||||
return "", ErrServiceUnreachable
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
if res.StatusCode != http.StatusOK {
|
||||
return manager.ErrUnauthorizedAccess, nil
|
||||
|
|
Loading…
Reference in New Issue