Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events dropped in streams with mixed CRLF and LF line terminators. #326

Open
WcRnm opened this issue Nov 16, 2023 · 2 comments
Open

Events dropped in streams with mixed CRLF and LF line terminators. #326

WcRnm opened this issue Nov 16, 2023 · 2 comments

Comments

@WcRnm
Copy link

WcRnm commented Nov 16, 2023

v2.0.2.

The server sent events spec states that lines must be terminated by LF, CR, or CRLF.

In the case where the field is terminated by a CRLF and the data and dispatch lines use a single LF, no events are emitted.

@piranna
Copy link
Member

piranna commented Nov 17, 2023

Maybe they should be unified?

@WcRnm
Copy link
Author

WcRnm commented Nov 17, 2023

Maybe they should be unified?

My first thought was that the code on the server I'm testing against should be fixed, but it does conform to the specification. These server-sent events are processed as expected by the EventSource implemented on browsers, and one should expect this implementation to process them as well.

This behavior is actually a secondary issue caused by a parsing bug in the eventsource code where each incoming packet is parsed repeatedly from the beginning, rather from the current offset.

I should be able to submit a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants