Chromium Code Reviews| Index: sdk/lib/io/http_impl.dart |
| diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart |
| index ce3c63a00fb9ae4072888ba92dab8f836d06cd48..698c162587e6e13039a031608557ff055dbf01cc 100644 |
| --- a/sdk/lib/io/http_impl.dart |
| +++ b/sdk/lib/io/http_impl.dart |
| @@ -405,7 +405,9 @@ abstract class _HttpOutboundMessage<T> implements IOSink { |
| } |
| void close() { |
| - if (!_headersWritten && !_ignoreBody && headers.chunkedTransferEncoding) { |
| + // TODO(ajohnsen): Currently, contentLength, chunkedTransferEncoding and |
| + // persistentConnection is not guaranteed to be in sync. |
| + if (!_headersWritten && !_ignoreBody && headers.contentLength == -1) { |
| // If no body was written, _ignoreBody is false (it's not a HEAD |
| // request) and the content-length is unspecified, set contentLength to 0. |
| headers.chunkedTransferEncoding = false; |
| @@ -433,7 +435,9 @@ abstract class _HttpOutboundMessage<T> implements IOSink { |
| response._httpRequest.headers[HttpHeaders.ACCEPT_ENCODING]; |
| List contentEncoding = headers[HttpHeaders.CONTENT_ENCODING]; |
| if (acceptEncodings != null && |
| - acceptEncodings.any((encoding) => encoding.toLowerCase() == "gzip") && |
| + acceptEncodings |
| + .expand((list) => list.split(",")) |
| + .any((encoding) => encoding.toLowerCase() == "gzip") && |
|
Søren Gjesse
2013/03/13 08:08:22
Trim whitespace here as well.
Anders Johnsen
2013/03/13 08:25:00
Done.
|
| contentEncoding == null) { |
| headers.set(HttpHeaders.CONTENT_ENCODING, "gzip"); |
| asGZip = true; |
| @@ -805,7 +809,7 @@ class _ChunkedTransformer extends StreamEventTransformer<List<int>, List<int>> { |
| } |
| void handleDone(EventSink<List<int>> sink) { |
| - handleData([], sink); |
| + handleData(const [], sink); |
| sink.close(); |
| } |