Closed yukw777 closed 1 year ago
I'm trying to use sse-starlette to stream raw bytes (e.g. live videos). I've noticed that EventSourceResponse tries to decode chunk for debug logging (https://github.com/sysid/sse-starlette/blob/28b06b9d277673a7a291bfdb0e9d496f7fe0a0ca/sse_starlette/sse.py#L206 and https://github.com/sysid/sse-starlette/blob/28b06b9d277673a7a291bfdb0e9d496f7fe0a0ca/sse_starlette/sse.py#L265), which raises a UnicodeDecodeError as chunk in my case is binary. What would be the best way to fix it? Happy to send a PR based on your suggestion.
sse-starlette
EventSourceResponse
chunk
UnicodeDecodeError
I'm trying to use
sse-starlette
to stream raw bytes (e.g. live videos). I've noticed thatEventSourceResponse
tries to decodechunk
for debug logging (https://github.com/sysid/sse-starlette/blob/28b06b9d277673a7a291bfdb0e9d496f7fe0a0ca/sse_starlette/sse.py#L206 and https://github.com/sysid/sse-starlette/blob/28b06b9d277673a7a291bfdb0e9d496f7fe0a0ca/sse_starlette/sse.py#L265), which raises aUnicodeDecodeError
aschunk
in my case is binary. What would be the best way to fix it? Happy to send a PR based on your suggestion.