static String _scanScheme()

in lib/src/authentication_challenge.dart [112:125]


  static String _scanScheme(StringScanner scanner, {String? whitespaceName}) {
    scanner.expect(token, name: 'a token');
    final scheme = scanner.lastMatch![0]!.toLowerCase();

    scanner.scan(whitespace);

    // The spec specifically requires a space between the scheme and its
    // params.
    if (scanner.lastMatch == null || !scanner.lastMatch![0]!.contains(' ')) {
      scanner.expect(' ', name: whitespaceName);
    }

    return scheme;
  }