MCPcopy Index your code
hub / github.com/coder/coder / newHTTPClientWithTransportFrom

Function newHTTPClientWithTransportFrom

coderd/coderdtest/coderdtest.go:711–724  ·  view source on GitHub ↗

newHTTPClientWithTransportFrom returns a fresh client that shares the base transport without sharing mutable per-client state like CheckRedirect.

(base *http.Client)

Source from the content-addressed store, hash-verified

709// newHTTPClientWithTransportFrom returns a fresh client that shares the base
710// transport without sharing mutable per-client state like CheckRedirect.
711func 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
727type ProvisionerdCloser struct {

Callers 1

createAnotherUserRetryFunction · 0.85

Calls 1

NewIsolatedHTTPClientFunction · 0.85

Tested by

no test coverage detected