| Index: tests/standalone/io/http_content_length_test.dart
|
| diff --git a/tests/standalone/io/http_content_length_test.dart b/tests/standalone/io/http_content_length_test.dart
|
| index cf2614588f647c6def0d187187f3c253d8ca7087..2baedb2b340cae5ea18f148af64719089e75b02b 100644
|
| --- a/tests/standalone/io/http_content_length_test.dart
|
| +++ b/tests/standalone/io/http_content_length_test.dart
|
| @@ -79,7 +79,32 @@ void testBody(int totalConnections) {
|
| }
|
| }
|
|
|
| +void testHttp10() {
|
| + HttpServer server = new HttpServer();
|
| + server.onError = (e) => Expect.fail("Unexpected error $e");
|
| + server.listen("127.0.0.1", 0, 5);
|
| + server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
|
| + OutputStream stream = response.outputStream;
|
| + Expect.equals("1.0", request.protocolVersion);
|
| + Expect.throws(() => stream.writeString("x"), (e) => e is HttpException);
|
| + response.contentLength = 0;
|
| + stream.close();
|
| + };
|
| +
|
| + Socket socket = new Socket("127.0.0.1", server.port);
|
| + socket.onConnect = () {
|
| + List<int> buffer = new List<int>(1024);
|
| + socket.outputStream.writeString("GET / HTTP/1.0\r\n\r\n");
|
| + socket.onData = () => socket.readList(buffer, 0, buffer.length);
|
| + socket.onClosed = () {
|
| + socket.close(true);
|
| + server.close();
|
| + };
|
| + };
|
| +}
|
| +
|
| void main() {
|
| testNoBody(5);
|
| testBody(5);
|
| + testHttp10();
|
| }
|
|
|