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

Feature: Better marshaling for SSE streamed events #49

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

stevenbunting
Copy link
Collaborator

SSE Streamed events were being stringified due to not being standard JSON. However, the format for SSEs are a well defined JSON object containing
{
event
id
retry
data
}
In this PR, we use the event-stream content type to detect for SSE streamed events, and marshal them into an array of SSE events as opposed to just stringifying the whole thing. This way, we can allow specific keys from within the streamed SSE while redacting others.

@stevenbunting stevenbunting merged commit 88a0c44 into master Jul 17, 2024
5 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.

2 participants