Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
What did you do?
What did you expect to see?
What did you see instead?
Recently I found this question on stack overflow, the OP asked why the r.Context().Done() channel does not receive any data on cancelled POST request. But it does receive data on cancelled GET request.
I tried to find the relevant explanation on the go doc, but I found nothing. Is this not documented?
The text was updated successfully, but these errors were encountered:
The net/http server checks for closed connections by reading the connection. No reads are started until the application starts reading the request body (if any).
What I mean is above statement. I think it's need to be documented.
On GET client request, when the request is cancelled from the client side then immediately r.Context().Done() channel receives a value. But on POST request, it does not.
On POST client request, the r.Context().Done() never receive any value, unless in the handler there is a read process from r.Body and during that reading process the request is cancelled by the client. Then only that the the channel will receive a value.