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; |
+ } |
} |
} |