wait for done before writing to shared resp body (#532)
Signed-off-by: Louis Delossantos <ldelossa.ld@gmail.com>
This commit is contained in:
parent
fc06704084
commit
12af604cf2
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue