fix(service): handle unexpected default transport type, simplify warning append

This commit is contained in:
ZeroDeng
2026-05-11 11:43:44 +08:00
parent 2a17c0b229
commit f788e6bdba
2 changed files with 7 additions and 5 deletions

View File

@@ -202,7 +202,11 @@ func newVertexServiceAccountHTTPClient(proxyURL string) (*http.Client, error) {
if err != nil {
return nil, err
}
transport := http.DefaultTransport.(*http.Transport).Clone()
defaultTransport, ok := http.DefaultTransport.(*http.Transport)
if !ok {
return nil, fmt.Errorf("unexpected default transport type %T", http.DefaultTransport)
}
transport := defaultTransport.Clone()
transport.Proxy = nil
if err := proxyutil.ConfigureTransportProxy(transport, parsedProxy); err != nil {
return nil, err