fix: do not read response body after successful authentication

This commit is contained in:
Marcel Gebhardt
2018-09-19 09:08:13 +02:00
committed by Marcel Gebhardt
parent 428a29c33a
commit 3b62ca2637

View File

@@ -103,12 +103,6 @@ func WrapDialContext(dialContext DialContext, proxyAddress, proxyUsername, proxy
debugf("ntlm> Could not read response from proxy: %s", err) debugf("ntlm> Could not read response from proxy: %s", err)
return conn, err return conn, err
} }
_, err = ioutil.ReadAll(resp.Body)
if err != nil {
debugf("ntlm> Could not read response body from proxy: %s", err)
return conn, err
}
resp.Body.Close()
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK {
debugf("ntlm> Expected %d as return status, got: %d", http.StatusOK, resp.StatusCode) debugf("ntlm> Expected %d as return status, got: %d", http.StatusOK, resp.StatusCode)
return conn, errors.New(http.StatusText(resp.StatusCode)) return conn, errors.New(http.StatusText(resp.StatusCode))