Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: sdk/lib/io/http_headers.dart

Issue 1426043002: Revert "Web Socket compression - take two" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/http.dart ('k') | sdk/lib/io/websocket.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « sdk/lib/io/http.dart ('k') | sdk/lib/io/websocket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698