circuitbreaker icon indicating copy to clipboard operation
circuitbreaker copied to clipboard

Use Request context for HTTPClient.Do

Open klauspost opened this issue 6 years ago • 0 comments

If the context is cancelled on the request the breaker considers that an error.

Instead of creating a new context, we use the one provided on the http.Request, which returns context.Background() if none is set. This should also make it backwards compatible, except for the issue we are fixing.

klauspost avatar Mar 15 '18 15:03 klauspost