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

fix(sse): skip sse incompatible chars of serde_json::RawValue #2992

Merged
merged 2 commits into from
Oct 17, 2024

Conversation

Threated
Copy link
Contributor

As discussed the writer will skip \n and also \r as I noticed it can also be a valid character between json object keys.

Closes #2981

@Threated
Copy link
Contributor Author

CI failure seems to be unrelated

Copy link
Collaborator

@mladedav mladedav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this 👍

Just two minor nits

axum/Cargo.toml Outdated Show resolved Hide resolved
axum/src/response/sse.rs Show resolved Hide resolved
Copy link
Collaborator

@mladedav mladedav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks.

I'll merge this once we get the CI working again.

Copy link
Member

@jplatte jplatte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind adding a changelog entry?

@mladedav mladedav merged commit 04fee94 into tokio-rs:main Oct 17, 2024
18 checks passed
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

Successfully merging this pull request may close these issues.

Event::json_data can construct an invalid SSE event by passing a serde_json::value::RawValue
3 participants