Skip to content

Commit

Permalink
Ensure response body is closed in DownloadAccessToken
Browse files Browse the repository at this point in the history
  • Loading branch information
bvwells committed Sep 11, 2020
1 parent a6e9dfb commit 852eff2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions example/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func DownloadAccessToken(url string, auth *osin.BasicAuth, output map[string]int
if err != nil {
return err
}
defer presp.Body.Close()

if presp.StatusCode != 200 {
return errors.New("Invalid status code")
Expand Down

0 comments on commit 852eff2

Please sign in to comment.