Skip to content

Commit 8cf345f

Browse files
jfsanchez91leehack
authored andcommitted
fix: remove trailing CR before processing the line
1 parent 9586075 commit 8cf345f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/client/streamable_https.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,10 @@ class StreamableHttpClientTransport implements Transport {
378378
// Process the buffer line by line
379379
while (buffer.contains('\n')) {
380380
final index = buffer.indexOf('\n');
381-
final line = buffer.substring(0, index);
381+
var line = buffer.substring(0, index);
382+
if (line.endsWith('\r')) {
383+
line = line.substring(0, line.length - 1);
384+
}
382385
buffer = buffer.substring(index + 1);
383386

384387
if (line.isEmpty) {

0 commit comments

Comments
 (0)