Skip to content

feat(volo-http): add SSE client support with Accept header validation for server side#643

Open
Joshuahoky wants to merge 12 commits intocloudwego:mainfrom
Joshuahoky:feat/sse_client
Open

feat(volo-http): add SSE client support with Accept header validation for server side#643
Joshuahoky wants to merge 12 commits intocloudwego:mainfrom
Joshuahoky:feat/sse_client

Conversation

@Joshuahoky
Copy link
Collaborator

Motivation

SSE (Server-Sent Events) support was missing a client-side implementation for parsing SSE streams, and the server-side had no validation of the Accept header.

Solution

Added SseReader for parsing SSE streams from server responses
Added SseExt extension trait on Response for converting a response into an SseReader via into_sse()
Added ResponseExt trait with is_sse() for checking if a response has Content-Type: text/event-stream
Added Accept header validation in Endpoint::call
Added client and server examples demonstrating SSE usage

@Joshuahoky Joshuahoky requested review from a team as code owners March 12, 2026 03:23
@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 95.14286% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.61%. Comparing base (6220d5b) to head (ce0c727).

Files with missing lines Patch % Lines
volo-http/src/server/response/sse.rs 0.00% 7 Missing ⚠️
volo-http/src/client/sse.rs 98.17% 6 Missing ⚠️
volo-http/src/server/route/router.rs 73.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #643      +/-   ##
==========================================
+ Coverage   43.72%   44.61%   +0.89%     
==========================================
  Files         161      162       +1     
  Lines       19679    20028     +349     
==========================================
+ Hits         8604     8936     +332     
- Misses      11075    11092      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant