trustedAuthenticationOrigin function

String? trustedAuthenticationOrigin(
  1. Uri address
)

Implementation

String? trustedAuthenticationOrigin(Uri address) {
  if (address.scheme.toLowerCase() == 'wss') {
    return canonicalAuthenticationOrigin(address);
  }
  var host = address.host.toLowerCase();
  if (host.endsWith('.')) host = host.substring(0, host.length - 1);
  if (address.scheme.toLowerCase() == 'ws' &&
      (host == 'localhost' || host == '127.0.0.1' || host == '::1')) {
    return canonicalAuthenticationOrigin(address);
  }
  return null;
}