Skip to content

Commit 1c85f03

Browse files
markphelpsCopilot
andcommitted
chore: Update flipt-client-go/config.go
Co-authored-by: Copilot <[email protected]> Signed-off-by: Mark Phelps <[email protected]>
1 parent a0a36ce commit 1c85f03

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

flipt-client-go/config.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,12 @@ func WithTlsConfig(tlsConfig *tls.Config) Option {
110110
if cfg.HTTPClient != nil {
111111
timeout = cfg.HTTPClient.Timeout
112112
if cfg.HTTPClient.Transport != nil {
113-
transport = cfg.HTTPClient.Transport.(*http.Transport).Clone()
113+
if t, ok := cfg.HTTPClient.Transport.(*http.Transport); ok {
114+
transport = t.Clone()
115+
} else {
116+
fmt.Println("Warning: HTTPClient.Transport is not of type *http.Transport. Falling back to default transport.")
117+
transport = defaultHTTPClient.Transport.(*http.Transport).Clone()
118+
}
114119
}
115120
}
116121

0 commit comments

Comments
 (0)