sseclient
sseclient copied to clipboard
Fix premature SSE event split on embedded line endings
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.
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.