Index: pkg/http/lib/src/multipart_request.dart |
diff --git a/pkg/http/lib/src/multipart_request.dart b/pkg/http/lib/src/multipart_request.dart |
index 3cd0dc405b32d124d9df8929bdbe7e68a02c8873..4d744c12210b55f67678667bb9413c3eb1886ff7 100644 |
--- a/pkg/http/lib/src/multipart_request.dart |
+++ b/pkg/http/lib/src/multipart_request.dart |
@@ -4,6 +4,7 @@ |
library multipart_request; |
+import 'dart:async'; |
import 'dart:io'; |
import 'dart:math'; |
import 'dart:uri'; |
@@ -106,7 +107,7 @@ class MultipartRequest extends BaseRequest { |
writeAscii('--$boundary\r\n'); |
writeAscii(_headerForFile(file)); |
return writeInputToInput(file.finalize(), stream) |
- .transform((_) => writeLine()); |
+ .then((_) => writeLine()); |
}).then((_) { |
// TODO(nweiz): pass any errors propagated through this future on to |
// the stream. See issue 3657. |
@@ -156,7 +157,7 @@ class MultipartRequest extends BaseRequest { |
/// [length]. |
String _boundaryString(int length) { |
var prefix = "dart-http-boundary-"; |
- var list = new List<int>(length - prefix.length); |
+ var list = new List<int>.fixedLength(length - prefix.length); |
for (var i = 0; i < list.length; i++) { |
list[i] = _BOUNDARY_CHARACTERS[ |
_random.nextInt(_BOUNDARY_CHARACTERS.length)]; |