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

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

Issue 77353005: Fix http headers to enable chunked transfer encoding when content-length is set to -1. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | no next file » | 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 b32748beda41dd683eea8cbd26dc28d6061cf705..62e940c2ffcb18ca9932baf885f6bcc291db21e8 100644
--- a/sdk/lib/io/http_headers.dart
+++ b/sdk/lib/io/http_headers.dart
@@ -123,12 +123,16 @@ class _HttpHeaders implements HttpHeaders {
"Trying to clear ContentLength on HTTP 1.0 headers with "
"'Connection: Keep-Alive' set");
}
+ if (_contentLength == contentLength) return;
_contentLength = contentLength;
if (_contentLength >= 0) {
if (chunkedTransferEncoding) chunkedTransferEncoding = false;
_set(HttpHeaders.CONTENT_LENGTH, contentLength.toString());
} else {
removeAll(HttpHeaders.CONTENT_LENGTH);
+ if (protocolVersion == "1.1") {
+ chunkedTransferEncoding = true;
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698