Browse Source

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 8 years ago
parent
commit
e345cd12f9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      client/client.go

+ 1 - 1
client/client.go

@@ -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 {