net/http: documentation unclear about when request body is closed #33244
Labels
Comments
Closing this. I'd say the |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: