mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
handle GET redirects
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
parent
e546c8cc1d
commit
4b4ad26b97
1 changed files with 7 additions and 4 deletions
|
@ -138,14 +138,17 @@ func NewDockerCli(in io.ReadCloser, out, err io.Writer, key libtrust.PrivateKey,
|
||||||
// The transport is created here for reuse during the client session
|
// The transport is created here for reuse during the client session
|
||||||
tr := &http.Transport{
|
tr := &http.Transport{
|
||||||
TLSClientConfig: tlsConfig,
|
TLSClientConfig: tlsConfig,
|
||||||
Dial: func(dial_network, dial_addr string) (net.Conn, error) {
|
|
||||||
// Why 32? See issue 8035
|
|
||||||
return net.DialTimeout(proto, addr, 32*time.Second)
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Why 32? See issue 8035
|
||||||
if proto == "unix" {
|
if proto == "unix" {
|
||||||
// no need in compressing for local communications
|
// no need in compressing for local communications
|
||||||
tr.DisableCompression = true
|
tr.DisableCompression = true
|
||||||
|
tr.Dial = func(network, addr string) (net.Conn, error) {
|
||||||
|
return net.DialTimeout("unix", addr, 32*time.Second)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tr.Dial = (&net.Dialer{Timeout: 32 * time.Second}).Dial
|
||||||
}
|
}
|
||||||
|
|
||||||
return &DockerCli{
|
return &DockerCli{
|
||||||
|
|
Loading…
Add table
Reference in a new issue