newHTTPClientWithTransportFrom returns a fresh client that shares the base transport without sharing mutable per-client state like CheckRedirect.
(base *http.Client)
| 709 | // newHTTPClientWithTransportFrom returns a fresh client that shares the base |
| 710 | // transport without sharing mutable per-client state like CheckRedirect. |
| 711 | func newHTTPClientWithTransportFrom(base *http.Client) *http.Client { |
| 712 | if base == nil { |
| 713 | return NewIsolatedHTTPClient(nil) |
| 714 | } |
| 715 | if base.Transport == nil { |
| 716 | client := NewIsolatedHTTPClient(nil) |
| 717 | client.Timeout = base.Timeout |
| 718 | return client |
| 719 | } |
| 720 | return &http.Client{ |
| 721 | Transport: base.Transport, |
| 722 | Timeout: base.Timeout, |
| 723 | } |
| 724 | } |
| 725 | |
| 726 | // ProvisionerdCloser wraps a provisioner daemon as an io.Closer that can be called multiple times |
| 727 | type ProvisionerdCloser struct { |
no test coverage detected