sseclient icon indicating copy to clipboard operation
sseclient copied to clipboard

Fix premature SSE event split on embedded line endings

Open TheSandDoctor opened this issue 9 months ago • 1 comments

Fixes bug #28 by changing how lines are parsed. Previously if a double line ending was embedded in the event it could trip up SSEClient and return early, resulting in an unterminated string/ValueError. This also helps to resolve a vulnerability identified by @decatur in this comment by eliminating a regular expression application on all buffered data for each chunk.

TheSandDoctor avatar Jun 04 '25 22:06 TheSandDoctor

This has been in continuous testing since last night but going to run it on the Wikimedia feed for a couple of days just to make sure that everything is working as desired, especially considering the relative rarity/randomness of the offending event message firing.

TheSandDoctor avatar Jun 04 '25 22:06 TheSandDoctor