redactProviderUrl function

String redactProviderUrl(
  1. Uri url
)

Renders url for watchdog/error text: scheme, host, port and path survive; userinfo and query are dropped — a custom provider's baseUrl can carry credentials (https://user:key@gateway/…, ?api_key=…), and the rendered assistant error lands in the transcript verbatim (issue #1036, review round 2).

Implementation

String redactProviderUrl(Uri url) {
  final port = url.hasPort ? ':${url.port}' : '';
  return '${url.scheme}://${url.host}$port${url.path}';
}