Fix sendFiles reader leak

pull/241/head
Viktor Oreshkin 5 years ago
parent a770d6d951
commit cbcedf0c92

@ -120,6 +120,7 @@ func (b *Bot) sendFiles(method string, files map[string]File,
if err != nil {
return nil, errors.Wrap(err, "http.Post failed")
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusInternalServerError {
return nil, errors.New("api error: internal server error")

Loading…
Cancel
Save