Index: utils/tests/pub/pub_lish_test.dart |
diff --git a/utils/tests/pub/pub_lish_test.dart b/utils/tests/pub/pub_lish_test.dart |
index 07c24fbbdd689587f557866289516c390d9e702d..d37962923de6596f491a0dcc77da259b1a289b5b 100644 |
--- a/utils/tests/pub/pub_lish_test.dart |
+++ b/utils/tests/pub/pub_lish_test.dart |
@@ -204,11 +204,17 @@ main() { |
handleUploadForm(server); |
server.handle('POST', '/upload', (request, response) { |
- response.statusCode = 400; |
- response.headers.contentType = new ContentType('application', 'xml'); |
- response.outputStream.writeString('<Error><Message>Your request sucked.' |
- '</Message></Error>'); |
- return closeHttpResponse(request, response); |
+ // TODO(rnystrom): HTTP requires that you don't start sending a response |
nweiz
2012/11/30 01:19:45
It's probably worth mentioning that curl will actu
Bob Nystrom
2012/11/30 01:42:45
Done.
|
+ // until the request has been completely sent, but dart:io doesn't |
+ // ensure that (#7044). Workaround it by manually consuming the entire |
+ // input stream before we start responding. |
+ return consumeInputStream(request.inputStream).transform((_) { |
+ response.statusCode = 400; |
+ response.headers.contentType = new ContentType('application', 'xml'); |
+ response.outputStream.writeString('<Error><Message>Your request sucked.' |
+ '</Message></Error>'); |
+ response.outputStream.close(); |
+ }); |
}); |
// TODO(nweiz): This should use the server's error message once the client |