gojek / heimdall

An enhanced HTTP client for Go
http://gojek.tech
Apache License 2.0
2.63k stars 214 forks source link

httpclient.Do forces closes connection #133

Open rajat25 opened 2 years ago

rajat25 commented 2 years ago

httpclient.Do forces closes connection whereas hystrix.Do doesn't. I am using httpclient.Do in my project, due to which my connection is forced closed after every request.

func (c *Client) Do(request *http.Request) (*http.Response, error) {

    request.Close = true
    var bodyReader *bytes.Reader

request.Close = true above closes the connection.

Edit: I see that a PR https://github.com/gojek/heimdall/pull/122 is raised to fix this but it is not yet merged. Can this be merged please?