mirror of https://github.com/docker/docs.git
fix tls in proxy func
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
parent
cccbd0baea
commit
0885c7b5b8
|
@ -45,14 +45,12 @@ func proxy(tlsConfig *tls.Config, container *cluster.Container, w http.ResponseW
|
|||
// RequestURI may not be sent to client
|
||||
r.RequestURI = ""
|
||||
|
||||
parts := strings.SplitN(container.Node.Addr, "://", 2)
|
||||
if len(parts) == 2 {
|
||||
r.URL.Scheme = parts[0]
|
||||
r.URL.Host = parts[1]
|
||||
if tlsConfig != nil {
|
||||
r.URL.Scheme = "https"
|
||||
} else {
|
||||
r.URL.Scheme = "http"
|
||||
r.URL.Host = parts[0]
|
||||
}
|
||||
r.URL.Host = container.Node.Addr
|
||||
|
||||
log.Debugf("[PROXY] --> %s %s", r.Method, r.URL)
|
||||
resp, err := client.Do(r)
|
||||
|
|
Loading…
Reference in New Issue