You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is extraneous whitespace at the beginning of each line of the event data retrieved from event.data property. I believe this is because the library treats the space between "data:" and the message body in SSE format as part of the message body.
In addition, there is an extra newline character at the end of the event data, which causes some parsing issues.
Steps to reproduce
Create an SSE server with Express.js that returns a text chunk as shown below:
Then print each char and its ascii code of the event.data string after receiving data from the server:
I/flutter ( 1067): --SUBSCRIBING TO SSE---
I/flutter ( 1067): 32
I/flutter ( 1067): p 112
I/flutter ( 1067): a 97
I/flutter ( 1067): r 114
I/flutter ( 1067): t 116
I/flutter ( 1067): - 45
I/flutter ( 1067): 1 49
I/flutter ( 1067): 10
I/flutter ( 1067): 32
I/flutter ( 1067): p 112
I/flutter ( 1067): a 97
I/flutter ( 1067): r 114
I/flutter ( 1067): t 116
I/flutter ( 1067): - 45
I/flutter ( 1067): 2 50
I/flutter ( 1067): 10
I/flutter ( 1067): 32
I/flutter ( 1067): p 112
I/flutter ( 1067): a 97
I/flutter ( 1067): r 114
I/flutter ( 1067): t 116
I/flutter ( 1067): - 45
I/flutter ( 1067): 3 51
I/flutter ( 1067): 10
It can be observed from the output that there is an extraneous whitespace (ASCII code 32) at the beginning of each line, and an extra newline character (ASCII code 10) at the end of the entire message block.
The text was updated successfully, but these errors were encountered:
Bug description
There is extraneous whitespace at the beginning of each line of the event data retrieved from event.data property. I believe this is because the library treats the space between "data:" and the message body in SSE format as part of the message body.
In addition, there is an extra newline character at the end of the event data, which causes some parsing issues.
Steps to reproduce
Create an SSE server with Express.js that returns a text chunk as shown below:
Create an SSE client with flutter_client_sse :
Then print each char and its ascii code of the event.data string after receiving data from the server:
It can be observed from the output that there is an extraneous whitespace (ASCII code 32) at the beginning of each line, and an extra newline character (ASCII code 10) at the end of the entire message block.
The text was updated successfully, but these errors were encountered: