mirror of
https://github.com/go-micro/go-micro.git
synced 2024-11-24 08:02:32 +02:00
Check for uninitialized *config.HttpClient
This commit is contained in:
parent
fd01ead575
commit
db0df07fd6
@ -59,6 +59,9 @@ func newConsulRegistry(opts ...Option) Registry {
|
||||
config = c
|
||||
}
|
||||
}
|
||||
if config.HttpClient == nil {
|
||||
config.HttpClient = new(http.Client)
|
||||
}
|
||||
|
||||
// set timeout
|
||||
if options.Timeout > 0 {
|
||||
@ -81,9 +84,6 @@ func newConsulRegistry(opts ...Option) Registry {
|
||||
if options.Secure || options.TLSConfig != nil {
|
||||
config.Scheme = "https"
|
||||
// We're going to support InsecureSkipVerify
|
||||
if config.HttpClient == nil {
|
||||
config.HttpClient = new(http.Client)
|
||||
}
|
||||
config.HttpClient.Transport = newTransport(options.TLSConfig)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user