From 8a833aa5b453ae39b22c049e073d7d79c51986b5 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 13 Sep 2023 11:20:10 -0700 Subject: [PATCH] No HTTP version --- .../lib/src/response_status_line_tests.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/http_client_conformance_tests/lib/src/response_status_line_tests.dart b/pkgs/http_client_conformance_tests/lib/src/response_status_line_tests.dart index edd11158b6..6f1dc2ac0e 100644 --- a/pkgs/http_client_conformance_tests/lib/src/response_status_line_tests.dart +++ b/pkgs/http_client_conformance_tests/lib/src/response_status_line_tests.dart @@ -26,11 +26,14 @@ void testResponseStatusLine(Client client) async { test( 'without HTTP version', () async { - httpServerChannel.sink.add('200 OK'); - await expectLater( - client.get(Uri.http(host, '')), - throwsA(isA()), - ); + httpServerChannel.sink.add('201 Created'); + try { + final response = await client.get(Uri.http(host, '')); + expect(response.statusCode, 201); + expect(response.reasonPhrase, 'Created'); + } on ClientException { + // A Http-Version is required according to RFC-2616 + } }, ); @@ -51,6 +54,7 @@ void testResponseStatusLine(Client client) async { httpServerChannel.sink.add('HTTP/1.1 201'); try { final response = await client.get(Uri.http(host, '')); + expect(response.statusCode, 201); // All of these responses seem reasonable. expect(response.reasonPhrase, anyOf(isNull, '', 'Created')); } on ClientException {