uriForLogging property

String get uriForLogging

Origin only by default. Overrides are responsible for their own privacy.

Implementation

String get uriForLogging {
  final value = uri;
  if (!value.hasScheme ||
      value.host.isEmpty ||
      (value.scheme != 'http' && value.scheme != 'https')) {
    return '[unavailable-origin]';
  }
  final host = value.host.contains(':') && !value.host.startsWith('[')
      ? '[${value.host}]'
      : value.host;
  return '${value.scheme}://$host${value.hasPort ? ':${value.port}' : ''}';
}