The docs say that if HttpClient is nil, http.DefaultClient will be used. However, the code doesn't do this, resulting in a nil dereference.

This commit is contained in:
Jeff Mitchell
2015-06-04 14:01:10 -04:00
parent a0ad309d1f
commit 6f5f247b28

View File

@@ -69,6 +69,10 @@ func NewClient(c *Config) (*Client, error) {
return nil, err
}
if c.HttpClient == nil {
c.HttpClient = http.DefaultClient
}
// Make a copy of the HTTP client so we can configure it without
// affecting the original
//