Browse code

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>

mrfly authored on 2017/08/03 18:04:26
Showing 1 changed files
... ...
@@ -165,7 +165,7 @@ func NewClient(host string, version string, client *http.Client, httpHeaders map
165 165
 	}
166 166
 
167 167
 	if client != nil {
168
-		if _, ok := client.Transport.(*http.Transport); !ok {
168
+		if _, ok := client.Transport.(http.RoundTripper); !ok {
169 169
 			return nil, fmt.Errorf("unable to verify TLS configuration, invalid transport %v", client.Transport)
170 170
 		}
171 171
 	} else {