wait for done before writing to shared resp body (#532)

Signed-off-by: Louis Delossantos <ldelossa.ld@gmail.com>
This commit is contained in:
Louis DeLosSantos 2019-01-28 03:53:16 -05:00 committed by Krasi Georgiev
parent fc06704084
commit 12af604cf2
1 changed files with 1 additions and 1 deletions

View File

@ -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()
}