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

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

Issue 1390353005: 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 | « no previous file | sdk/lib/io/websocket.dart » ('j') | sdk/lib/io/websocket.dart » ('J')
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 47001282fce35a26c2eba1d4b7bfc8f3e1bc419a..372a3d83d5e2cb2e0e1c4145eaf2b6dac55700cf 100644
--- a/sdk/lib/io/http_headers.dart
+++ b/sdk/lib/io/http_headers.dart
@@ -681,6 +681,7 @@ class _HeaderValue implements HeaderValue {
while (!done()) {
if (s[index] == " " ||
s[index] == "\t" ||
+ s[index] == "," ||
s[index] == parameterSeparator) break;
index++;
}
@@ -705,7 +706,10 @@ class _HeaderValue implements HeaderValue {
String parseParameterName() {
int start = index;
while (!done()) {
- if (s[index] == " " || s[index] == "\t" || s[index] == "=") break;
+ if (s[index] == " " ||
+ s[index] == "\t" ||
+ s[index] == "=" ||
+ s[index] == ",") break;
index++;
}
return s.substring(start, index).toLowerCase();
@@ -735,7 +739,8 @@ class _HeaderValue implements HeaderValue {
return sb.toString();
} else {
// Parse non-quoted value.
- return parseValue();
+ var val = parseValue();
+ return val == "" ? null : val;
}
}
@@ -744,7 +749,7 @@ class _HeaderValue implements HeaderValue {
if (done()) return;
String name = parseParameterName();
skipWS();
- expect("=");
+ maybeExpect("=");
skipWS();
String value = parseParameterValue();
if (name == 'charset' && this is _ContentType) {
@@ -754,6 +759,8 @@ class _HeaderValue implements HeaderValue {
parameters[name] = value;
skipWS();
if (done()) return;
+ // TODO: Implement support for multi-valued parameters.
+ if(s[index] == ",") return;
expect(parameterSeparator);
}
}
« no previous file with comments | « no previous file | sdk/lib/io/websocket.dart » ('j') | sdk/lib/io/websocket.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698