fix(service): handle unexpected default transport type, simplify warning append
This commit is contained in:
@@ -211,9 +211,7 @@ func (h *AccountHandler) importCodexSessions(ctx context.Context, req CodexSessi
|
||||
})
|
||||
continue
|
||||
}
|
||||
for _, warning := range expiryWarnings {
|
||||
item.WarningTexts = append(item.WarningTexts, warning)
|
||||
}
|
||||
item.WarningTexts = append(item.WarningTexts, expiryWarnings...)
|
||||
if credentialExpiresAt != nil {
|
||||
item.Credentials["expires_at"] = credentialExpiresAt.Format(time.RFC3339)
|
||||
}
|
||||
@@ -565,7 +563,7 @@ func normalizeCodexImportEntry(entry codexImportEntry) (*codexImportAccount, err
|
||||
}
|
||||
if item.IDToken != "" {
|
||||
item.Credentials["id_token"] = item.IDToken
|
||||
enrichCodexImportAccountFromJWT(item, item.IDToken, false, now)
|
||||
_ = enrichCodexImportAccountFromJWT(item, item.IDToken, false, now)
|
||||
}
|
||||
if err := enrichCodexImportAccountFromJWT(item, item.AccessToken, true, now); err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user