1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

fix client.Transport

`client.Transport` is `http.Client.Transport` just has `RoundTripper()`. Not `http.Transport`. So we cannot convert it here.

For a mock test, I can play with this https://play.golang.org/p/gs7_QrL9-Y

Signed-off-by: wrfly <mr.wrfly@gmail.com>
This commit is contained in:
mrfly 2017-08-03 17:04:26 +08:00 committed by wrfly
parent 316b4ba9c2
commit e345cd12f9

View file

@ -165,7 +165,7 @@ func NewClient(host string, version string, client *http.Client, httpHeaders map
}
if client != nil {
if _, ok := client.Transport.(*http.Transport); !ok {
if _, ok := client.Transport.(http.RoundTripper); !ok {
return nil, fmt.Errorf("unable to verify TLS configuration, invalid transport %v", client.Transport)
}
} else {