Prechádzať zdrojové kódy

Merge pull request #39673 from thaJeztah/fix_client_HTTPClient

fix client.HTTPClient() not returning a copy
Yong Tang 6 rokov pred
rodič
commit
ecdb0b2239
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      client/client.go

+ 2 - 1
client/client.go

@@ -252,7 +252,8 @@ func (cli *Client) DaemonHost() string {
 
 // HTTPClient returns a copy of the HTTP client bound to the server
 func (cli *Client) HTTPClient() *http.Client {
-	return &*cli.client
+	c := *cli.client
+	return &c
 }
 
 // ParseHostURL parses a url string, validates the string is a host url, and