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

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

Issue 12383048: Improve support for HTTP 1.0 clients (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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/http_impl.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 1eb3275dded2c7f574aef5c2e757ddc44ab728a1..9d586d4c08fa5a09b3a9e769f93a443eec906cbf 100644
--- a/sdk/lib/io/http_headers.dart
+++ b/sdk/lib/io/http_headers.dart
@@ -50,6 +50,7 @@ class _HttpHeaders implements HttpHeaders {
if (index != -1) {
values.removeRange(index, 1);
}
+ if (values.length == 0) _headers.remove(name);
}
}
@@ -322,8 +323,12 @@ class _HttpHeaders implements HttpHeaders {
void _finalize() {
// If the content length is not known make sure chunked transfer
// encoding is used for HTTP 1.1.
- if (contentLength < 0 && protocolVersion == "1.1") {
- chunkedTransferEncoding = true;
+ if (contentLength < 0) {
+ if (protocolVersion == "1.0") {
+ persistentConnection = false;
+ } else {
+ chunkedTransferEncoding = true;
+ }
}
// If a Transfer-Encoding header field is present the
// Content-Length header MUST NOT be sent (RFC 2616 section 4.4).
« no previous file with comments | « no previous file | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698