diff --git a/CHANGELOG.md b/CHANGELOG.md index b46f3d1..ec1cc74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +## [1.2.1] - 2023-01-22 + +### Changed + +- Fix bug passing no timeout in client as 0 timeout in context . + ## [1.2.0] - 2024-01-22 ### Added diff --git a/nethttp_request_adapter.go b/nethttp_request_adapter.go index a4dcc58..bfd0a0b 100644 --- a/nethttp_request_adapter.go +++ b/nethttp_request_adapter.go @@ -214,7 +214,8 @@ func (a *NetHttpRequestAdapter) prepareContext(ctx context.Context, requestInfo ctx = context.Background() } // set deadline if not set in receiving context - if _, deadlineSet := ctx.Deadline(); !deadlineSet { + // ignore if timeout is 0 as it means no timeout + if _, deadlineSet := ctx.Deadline(); !deadlineSet && a.httpClient.Timeout != 0 { ctx, _ = context.WithTimeout(ctx, a.httpClient.Timeout) }