Commit d3fa3ffd authored by Elena Morozova's avatar Elena Morozova
Browse files

Close body after error check

Otherwise it panics for nil body
parent adf8147a
......@@ -29,10 +29,10 @@ func NotifyReboot(hookURL, username, nodeID string) error {
}
resp, err := httpClient.Post(hookURL, "application/json", &buf)
defer resp.Body.Close()
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return fmt.Errorf(resp.Status)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment