You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is currently possible for a request body to be read, even afterhttp.Client.Do returns. This can be a source of potential race conditions. It is currently unclear in the documentation that this can happen. To the contrary, the documentation is hinting at the fact that the request body will be closed after the function returns, at least to my understanding. To illustrate, the attached playground example reproduces the problem, when compiled with the -race flag:
Closing this. I'd say the http.RoundTripper + http.Client.Do documentations pretty much hint at this, even if unexpected. I'm not sure if this can be further improved in any way.
It is currently possible for a request body to be read, even after
http.Client.Do
returns. This can be a source of potential race conditions. It is currently unclear in the documentation that this can happen. To the contrary, the documentation is hinting at the fact that the request body will be closed after the function returns, at least to my understanding. To illustrate, the attached playground example reproduces the problem, when compiled with the-race
flag:https://play.golang.org/p/Z0t0QEawcev
The purpose of this issue is to clarify whether:
Useful links:
The text was updated successfully, but these errors were encountered: