Skip to content

Commit

Permalink
fix inconsistent test server behavior (#1227)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anikate-De authored Jun 7, 2024
1 parent a3567f8 commit b522000
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ void hybridMain(StreamChannel<Object?> channel) async {
final request = utf8.decoder.bind(socket).transform(const LineSplitter());

final cookies = <String>[];
request.listen((line) {
await for (final line in request) {
if (line.toLowerCase().startsWith('cookie:')) {
cookies.add(line);
}

if (line.isEmpty) {
// A blank line indicates the end of the headers.
channel.sink.add(cookies);
break;
}
});
}

socket.writeAll(
[
Expand Down

0 comments on commit b522000

Please sign in to comment.