-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpClient] [EventSourceHttpClient] Fix consuming SSEs with \r\n separator #54242
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
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
There's another regex line 147 but I didn't modify it for safety (since we're on 5.4). It's untested, so its goal is unclear. Judging from the pattern, the intention might be to yield SSE comments (line starting with a colon) as cc @nicolas-grekas @dunglas @soyuka since you worked on the initial implementation and you might remember something 🙏 |
src/Symfony/Component/HttpClient/Tests/EventSourceHttpClientTest.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, when the line starts with a colon we need to skip see https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation
3cf2735
to
2c095d8
Compare
yep, that's what we do on L147 |
It's not working as expected. I'll propose a patch, but on 7.1 because it's going to change the behavior heavily. Is that OK for you? |
Not sure: if we don't follow the spec, that's a bug and we need to fix it in 5.4. |
We don't follow the spec but we've been yielding comments as SSE for more than 3 years 😅 |
It doesn't matter, we don't want to preserve BC for a private buggy protocol :) |
Thank you @fancyweb. |
\r\n
separator never worked because it splits on every line because of[\r\n]
.