Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escaping Newlines #96

Closed
CiberNin opened this issue Apr 18, 2024 · 1 comment
Closed

Escaping Newlines #96

CiberNin opened this issue Apr 18, 2024 · 1 comment

Comments

@CiberNin
Copy link

I'm trying to use sse-starlette with datastar, which expects server sent events with fragments likefragment <div id='test'>\nUpdated\n</div>
However it looks like starlette-sse always splits the data into multiple data lines when it encounters a newline.
if self.data is not None: for chunk in self.LINE_SEP_EXPR.split(str(self.data)): buffer.write(f"data: {chunk}") buffer.write(self._sep)
Unless my generator outputs bytes directly.

Is there any way to escape my newlines?

@sysid
Copy link
Owner

sysid commented Jun 5, 2024

sse-starlette tries to implement the SSE standard. If there is a bug or misinterpretation, please let me know.

@sysid sysid closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants