aiohttp-sse
aiohttp-sse copied to clipboard
Invalid event stream format for multiline data
If data is multiline with \n as line separator (like in the provided examples/simple.py), the generated stream does not conform to the Server-Sent Events specification:
data: {
"time": "Server Time : 2021-01-11 23:35:07.354653"
}
Expected is
data: {
data: "time": "Server Time : 2021-01-11 23:35:07.354653"
data: }
Fix:
In aiohttp-sse.__init__, replace for chunk in data.split('\r\n'): with for chunk in data.splitlines():