Skip to content

Commit

Permalink
wait for done before writing to shared resp body (#532)
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Delossantos <ldelossa.ld@gmail.com>
  • Loading branch information
Louis DeLosSantos authored and krasi-georgiev committed Jan 28, 2019
1 parent fc06704 commit 12af604
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ func (c *httpClient) Do(ctx context.Context, req *http.Request) (*http.Response,

select {
case <-ctx.Done():
err = resp.Body.Close()
<-done
err = resp.Body.Close()
if err == nil {
err = ctx.Err()
}
Expand Down

0 comments on commit 12af604

Please sign in to comment.