Skip to content

Commit

Permalink
Fix sendFiles reader leak
Browse files Browse the repository at this point in the history
  • Loading branch information
stek29 committed Dec 25, 2019
1 parent a770d6d commit cbcedf0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit cbcedf0

Please sign in to comment.