Closed huaxiansha closed 7 years ago
As far as i know, the resp.Body will not be used after resp.Body.Close() So, I think resp.Body should be closed by user because user may need to get the content of resp.Body.
@huaxiansha sorry it's been a while and I forgot what was the mechanism. You are correct that my previous fix was wrong. After looking into it in more detail I have added the resp.Body.Close()
into only when a 401 is returned, and if it's normal response it should not close the body.
response body not close , whitch created in func (dr DigestRequest) Execute() (resp http.Response, err error)
user only can get and close the response body created in func (dr DigestRequest) executeRequest(authString string) (http.Response, error), but the response body created in func (dr DigestRequest) Execute() (resp http.Response, err error) is not close anywhere.
i think can add resp.Body.Close() after line 102 in file digest_auth_client.go, is it right