Index: sdk/lib/io/http_headers.dart |
diff --git a/sdk/lib/io/http_headers.dart b/sdk/lib/io/http_headers.dart |
index 676e4a88e10ebed8c0ceb33b340ca026c0a62ea5..47001282fce35a26c2eba1d4b7bfc8f3e1bc419a 100644 |
--- a/sdk/lib/io/http_headers.dart |
+++ b/sdk/lib/io/http_headers.dart |
@@ -630,11 +630,10 @@ class _HeaderValue implements HeaderValue { |
static _HeaderValue parse(String value, |
{parameterSeparator: ";", |
- valueSeparator: null, |
preserveBackslash: false}) { |
// Parse the string. |
var result = new _HeaderValue(); |
- result._parse(value, parameterSeparator, valueSeparator, preserveBackslash); |
+ result._parse(value, parameterSeparator, preserveBackslash); |
return result; |
} |
@@ -665,10 +664,7 @@ class _HeaderValue implements HeaderValue { |
return sb.toString(); |
} |
- void _parse(String s, |
- String parameterSeparator, |
- String valueSeparator, |
- bool preserveBackslash) { |
+ void _parse(String s, String parameterSeparator, bool preserveBackslash) { |
int index = 0; |
bool done() => index == s.length; |
@@ -685,7 +681,6 @@ class _HeaderValue implements HeaderValue { |
while (!done()) { |
if (s[index] == " " || |
s[index] == "\t" || |
- s[index] == valueSeparator || |
s[index] == parameterSeparator) break; |
index++; |
} |
@@ -710,17 +705,14 @@ class _HeaderValue implements HeaderValue { |
String parseParameterName() { |
int start = index; |
while (!done()) { |
- if (s[index] == " " || |
- s[index] == "\t" || |
- s[index] == "=" || |
- s[index] == valueSeparator) break; |
+ if (s[index] == " " || s[index] == "\t" || s[index] == "=") break; |
index++; |
} |
return s.substring(start, index).toLowerCase(); |
} |
String parseParameterValue() { |
- if (!done() && s[index] == "\"") { |
+ if (s[index] == "\"") { |
// Parse quoted value. |
StringBuffer sb = new StringBuffer(); |
index++; |
@@ -743,8 +735,7 @@ class _HeaderValue implements HeaderValue { |
return sb.toString(); |
} else { |
// Parse non-quoted value. |
- var val = parseValue(); |
- return val == "" ? null : val; |
+ return parseValue(); |
} |
} |
@@ -753,16 +744,8 @@ class _HeaderValue implements HeaderValue { |
if (done()) return; |
String name = parseParameterName(); |
skipWS(); |
- if (done()) { |
- parameters[name] = null; |
- return; |
- } |
- maybeExpect("="); |
+ expect("="); |
skipWS(); |
- if(done()) { |
- parameters[name] = null; |
- return; |
- } |
String value = parseParameterValue(); |
if (name == 'charset' && this is _ContentType) { |
// Charset parameter of ContentTypes are always lower-case. |
@@ -771,8 +754,6 @@ class _HeaderValue implements HeaderValue { |
parameters[name] = value; |
skipWS(); |
if (done()) return; |
- // TODO: Implement support for multi-valued parameters. |
- if(s[index] == valueSeparator) return; |
expect(parameterSeparator); |
} |
} |
@@ -819,7 +800,7 @@ class _ContentType extends _HeaderValue implements ContentType { |
static _ContentType parse(String value) { |
var result = new _ContentType._(); |
- result._parse(value, ";", null, false); |
+ result._parse(value, ";", false); |
int index = result._value.indexOf("/"); |
if (index == -1 || index == (result._value.length - 1)) { |
result._primaryType = result._value.trim().toLowerCase(); |