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

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

Issue 2225003002: Handle HTTP header parameters with empty values better (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Addressed review comments Created 4 years, 4 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 | « CHANGELOG.md ('k') | tests/standalone/io/http_headers_test.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 6b14ae2d6c89208388f3ed676f8f12b537e3de49..3769b3f0d04949bb1aa6e1ce5bbfee041ef9aa21 100644
--- a/sdk/lib/io/http_headers.dart
+++ b/sdk/lib/io/http_headers.dart
@@ -760,12 +760,12 @@ class _HeaderValue implements HeaderValue {
}
maybeExpect("=");
skipWS();
- if(done()) {
+ if (done()) {
parameters[name] = null;
return;
}
String value = parseParameterValue();
- if (name == 'charset' && this is _ContentType) {
+ if (name == 'charset' && this is _ContentType && value != null) {
// Charset parameter of ContentTypes are always lower-case.
value = value.toLowerCase();
}
« no previous file with comments | « CHANGELOG.md ('k') | tests/standalone/io/http_headers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698