Create a custom client that sends a custom User-Agent.

This commit is contained in:
Mariano Cano 2019-11-27 17:30:06 -08:00 committed by max furman
parent f0eb12372b
commit d2b1f1547f
2 changed files with 62 additions and 20 deletions

View file

@ -156,8 +156,8 @@ func TestBootstrap(t *testing.T) {
if !reflect.DeepEqual(got.endpoint, tt.want.endpoint) {
t.Errorf("Bootstrap() endpoint = %v, want %v", got.endpoint, tt.want.endpoint)
}
gotTR := got.client.Transport.(*http.Transport)
wantTR := tt.want.client.Transport.(*http.Transport)
gotTR := got.client.GetTransport().(*http.Transport)
wantTR := tt.want.client.GetTransport().(*http.Transport)
if !reflect.DeepEqual(gotTR.TLSClientConfig.RootCAs, wantTR.TLSClientConfig.RootCAs) {
t.Errorf("Bootstrap() certPool = %v, want %v", gotTR.TLSClientConfig.RootCAs, wantTR.TLSClientConfig.RootCAs)
}