hi guys,
When i was doing a http api performance benchmark, i found a lot of connections of status of "TIME_WAIT". I have tried to change the value of Transport.MaxConnsPerHost, but still not working. After a long time debuging, i finally found that api response header contains "
Connection: close", so that the connection was closed. But when i dump the request and response with httputil.DumpResponse, i cannot see the "Connection: close" header. This is weird!
After read the source code, i found that last parameter of function "http.shouldClose", removeCloseHeader was set to true when target is response. Once headers contains "Connection: close", the header will be removed.
so my question is, what's the purpose of the design. leaving the header exists will be be helpful for debuging, why remove it?
thanks a lot if someone could answer my doubts.