net/http: client doesn't check for canceled context (delegates it to the Transport) #46206
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. Also on go1.16.4
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Wanted all tests to pass
What did you see instead?
undocumented behavior.
There is commit that has added a test for another issue. But as it spawns a server, it doesn't see the problem when using custom transport.
The request context is checked here but it only checks for deadline and not cancelations.
Also as must people use the DefaultTransport this bug does not show itself. But it is an undocumented behavior which either needs to be fixed(which is an easy task) or it must be documented that a
RoundTripper
must handle this.The text was updated successfully, but these errors were encountered: