sseclient can't detect end of next event?
docelic opened this issue · 4 comments
docelic commented
I am connecting to a server and not receiving any server-sent events.
After looking into the code, this is because in sseclient.py function next(), the code beginning with while not self._event_complete()
never completes, so it doesn't complete and process any events, but it only appends to the internal buffer.
Any hints why this might be happening? Thanks.
docelic commented
Can the issue be in:
self.buf += decoder.decode(next_chunk)
End of field is searched using a regex r'\r\n\r\n|\r\r|\n\n'
, which leads me to believe that the content of self.buf
should be string.
However, if I print self.buf
, the content is all binary.
docelic commented
Found the root cause - the server's response is gzip-encoded and this is reaching the SSE client in raw form.
GPistre commented
So, what was your solution ?