Closed ferhatelmas closed 2 months ago
The logic of the standard library is used here: https://github.com/golang/go/blob/go1.22.2/src/net/http/transport.go#L1485
If you think there is a problem, you can submit a PR to the upstream standard library
Standard library does the right thing. Merge is done wrong.
See the difference: https://github.com/imroc/req/commit/d0373d27487a0fac2a5005e258747bcccb5e44e8#diff-5982a4ca350449c8a5deba675bc4bc4bb0f1823c45e6c7ba0076cc6b159fef8fL1818 https://github.com/golang/go/blob/master/src/net/http/transport.go#L1510
Oh yeah, sorry I misunderstood before, this is a nice catch!
Is it possible to cut a new release for the fix?
Released in v3.43.2 @ferhatelmas
It's lock protected and not safe for concurrent use. It should use previously read context. Otherwise, can panic under high concurrency.