MCPcopy
hub / github.com/grpc/grpc-go / overrideHTTPClient

Function overrideHTTPClient

credentials/sts/sts_test.go:147–151  ·  credentials/sts/sts_test.go::overrideHTTPClient

Overrides the http.Client with the provided fakeClient.

(fc *testutils.FakeHTTPClient)

Source from the content-addressed store, hash-verified

145
146// Overrides the http.Client with the provided fakeClient.
147func overrideHTTPClient(fc *testutils.FakeHTTPClient) func() {
148 origMakeHTTPDoer := makeHTTPDoer
149 makeHTTPDoer = func(_ *x509.CertPool) httpDoer { return fc }
150 return func() { makeHTTPDoer = origMakeHTTPDoer }
151}
152
153// Overrides the subject token read to return a const which we can compare in
154// our tests.

Calls

no outgoing calls

Tested by

no test coverage detected