Index: lib/src/authentication_challenge.dart |
diff --git a/lib/src/authentication_challenge.dart b/lib/src/authentication_challenge.dart |
index 3b70fed46e7b77456df378a57bd39515f115b06a..773ee3b81b6c8d45849a234f7de5f19c1f11b8bc 100644 |
--- a/lib/src/authentication_challenge.dart |
+++ b/lib/src/authentication_challenge.dart |
@@ -8,6 +8,7 @@ import 'dart:collection'; |
import 'package:string_scanner/string_scanner.dart'; |
+import 'case_insensitive_map.dart'; |
import 'scan.dart'; |
import 'utils.dart'; |
@@ -26,7 +27,8 @@ class AuthenticationChallenge { |
/// The parameters describing how to authenticate. |
/// |
- /// The semantics of these parameters are scheme-specific. |
+ /// The semantics of these parameters are scheme-specific. The keys of this |
+ /// map are case-insensitive. |
final Map<String, String> parameters; |
/// Parses a WWW-Authenticate header, which should contain one or more |
@@ -59,7 +61,7 @@ class AuthenticationChallenge { |
if (scanner.matches(",") || scanner.isDone) continue; |
scanner.expect(token, name: "a token"); |
- var name = scanner.lastMatch[0].toLowerCase(); |
+ var name = scanner.lastMatch[0]; |
scanner.scan(whitespace); |
// If there's no "=", then this is another challenge rather than a |
@@ -129,7 +131,7 @@ class AuthenticationChallenge { |
/// Scans a single authentication parameter and stores its result in [params]. |
static void _scanAuthParam(StringScanner scanner, Map params) { |
scanner.expect(token, name: "a token"); |
- var name = scanner.lastMatch[0].toLowerCase(); |
+ var name = scanner.lastMatch[0]; |
scanner.scan(whitespace); |
scanner.expect('='); |
scanner.scan(whitespace); |
@@ -146,5 +148,6 @@ class AuthenticationChallenge { |
/// Creates a new challenge value with [scheme] and [parameters]. |
AuthenticationChallenge(this.scheme, Map<String, String> parameters) |
- : parameters = new UnmodifiableMapView(parameters); |
+ : parameters = new UnmodifiableMapView( |
+ new CaseInsensitiveMap.from(parameters)); |
} |