Index: pkg/http/test/utils.dart |
diff --git a/pkg/http/test/utils.dart b/pkg/http/test/utils.dart |
index 9e0d01065f3460934b7e6ada819d74485b8fc8be..3548df015d53e9946732ba29809142a8e777cf3a 100644 |
--- a/pkg/http/test/utils.dart |
+++ b/pkg/http/test/utils.dart |
@@ -29,7 +29,7 @@ void startServer() { |
(request, response) { |
response.statusCode = 400; |
response.contentLength = 0; |
- closeResponse(request, response); |
+ response.outputStream.close(); |
}); |
_server.addRequestHandler((request) => request.path == '/loop', |
@@ -39,7 +39,7 @@ void startServer() { |
response.headers.set('location', |
serverUrl.resolve('/loop?${n + 1}').toString()); |
response.contentLength = 0; |
- closeResponse(request, response); |
+ response.outputStream.close(); |
}); |
_server.addRequestHandler((request) => request.path == '/redirect', |
@@ -47,7 +47,7 @@ void startServer() { |
response.statusCode = 302; |
response.headers.set('location', serverUrl.resolve('/').toString()); |
response.contentLength = 0; |
- closeResponse(request, response); |
+ response.outputStream.close(); |
}); |
_server.defaultRequestHandler = (request, response) { |
@@ -104,15 +104,6 @@ void stopServer() { |
_server = null; |
} |
-/// Closes [response] while ignoring the body of [request]. |
-/// |
-/// Due to issue 6984, it's necessary to drain the request body before closing |
-/// the response. |
-void closeResponse(HttpRequest request, HttpResponse response) { |
- request.inputStream.onData = request.inputStream.read; |
- request.inputStream.onClosed = response.outputStream.close; |
-} |
- |
/// A matcher that matches JSON that parses to a value that matches the inner |
/// matcher. |
Matcher parse(matcher) => new _Parse(matcher); |