mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 11:38:02 +00:00
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:
@@ -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
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user