mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
proxy: determine scheme based on TLSClientConfig
This commit is contained in:
parent
1ea3197feb
commit
73504dca41
@ -5,7 +5,12 @@ import (
|
||||
)
|
||||
|
||||
func NewHandler(t *http.Transport, addrs []string) (http.Handler, error) {
|
||||
d, err := newDirector("http", addrs)
|
||||
scheme := "http"
|
||||
if t.TLSClientConfig != nil {
|
||||
scheme = "https"
|
||||
}
|
||||
|
||||
d, err := newDirector(scheme, addrs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user