From 7146e97dc5215e40dfb6b5939f85a42b67ac4e10 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Wed, 5 Jun 2024 19:56:17 +0530 Subject: [PATCH] fix inconsistent test server behavior Co-authored-by: Brian Quinlan --- .../lib/src/request_cookies_server.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/http_client_conformance_tests/lib/src/request_cookies_server.dart b/pkgs/http_client_conformance_tests/lib/src/request_cookies_server.dart index 44653a7cd5..512fb5b1b4 100644 --- a/pkgs/http_client_conformance_tests/lib/src/request_cookies_server.dart +++ b/pkgs/http_client_conformance_tests/lib/src/request_cookies_server.dart @@ -25,7 +25,7 @@ void hybridMain(StreamChannel channel) async { final request = utf8.decoder.bind(socket).transform(const LineSplitter()); final cookies = []; - request.listen((line) { + await for (final line in request) { if (line.toLowerCase().startsWith('cookie:')) { cookies.add(line); } @@ -33,8 +33,9 @@ void hybridMain(StreamChannel channel) async { if (line.isEmpty) { // A blank line indicates the end of the headers. channel.sink.add(cookies); + break; } - }); + } socket.writeAll( [