Skip to content

Commit

Permalink
fix inconsistent test server behavior
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Quinlan <brian@sweetapp.com>
  • Loading branch information
Anikate-De and brianquinlan committed Jun 5, 2024
1 parent eb87a60 commit 7146e97
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 7146e97

Please sign in to comment.