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

Unified Diff: pkg/http/lib/src/utils.dart

Issue 11293289: Make the HTTP MockClient work with GET requests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | pkg/http/test/mock_client_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/utils.dart
diff --git a/pkg/http/lib/src/utils.dart b/pkg/http/lib/src/utils.dart
index e75cbd58dcbb8ac333958ea213ae1bd319bbc140..665ee1ef388fdeeedf2c8f45515be8d6e94ae39b 100644
--- a/pkg/http/lib/src/utils.dart
+++ b/pkg/http/lib/src/utils.dart
@@ -133,6 +133,8 @@ Uint8List toUint8List(List<int> input) {
/// Buffers all input from an InputStream and returns it as a future.
Future<List<int>> consumeInputStream(InputStream stream) {
+ if (stream.closed) return new Future<List<int>>.immediate(<int>[]);
+
var completer = new Completer<List<int>>();
/// TODO(nweiz): use BufferList when issue 6409 is fixed
var buffer = <int>[];
« no previous file with comments | « no previous file | pkg/http/test/mock_client_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698