Skip to content

Commit b522000

Browse files
authored
fix inconsistent test server behavior (#1227)
1 parent a3567f8 commit b522000

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkgs/http_client_conformance_tests/lib/src/request_cookies_server.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ void hybridMain(StreamChannel<Object?> channel) async {
2525
final request = utf8.decoder.bind(socket).transform(const LineSplitter());
2626

2727
final cookies = <String>[];
28-
request.listen((line) {
28+
await for (final line in request) {
2929
if (line.toLowerCase().startsWith('cookie:')) {
3030
cookies.add(line);
3131
}
3232

3333
if (line.isEmpty) {
3434
// A blank line indicates the end of the headers.
3535
channel.sink.add(cookies);
36+
break;
3637
}
37-
});
38+
}
3839

3940
socket.writeAll(
4041
[

0 commit comments

Comments
 (0)