solve NewRegistry httpclient 'nil pointer dereference' bug
This commit is contained in:
		| @@ -105,12 +105,13 @@ func configure(c *consulRegistry, opts ...registry.Option) { | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	// requires secure connection? |  | ||||||
| 	if c.opts.Secure || c.opts.TLSConfig != nil { |  | ||||||
| 	if config.HttpClient == nil { | 	if config.HttpClient == nil { | ||||||
| 		config.HttpClient = new(http.Client) | 		config.HttpClient = new(http.Client) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	// requires secure connection? | ||||||
|  | 	if c.opts.Secure || c.opts.TLSConfig != nil { | ||||||
|  | 		 | ||||||
| 		config.Scheme = "https" | 		config.Scheme = "https" | ||||||
| 		// We're going to support InsecureSkipVerify | 		// We're going to support InsecureSkipVerify | ||||||
| 		config.HttpClient.Transport = newTransport(c.opts.TLSConfig) | 		config.HttpClient.Transport = newTransport(c.opts.TLSConfig) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user