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

Disable response buffering for SSE responses #208

Merged

Conversation

halter73
Copy link
Contributor

@halter73 halter73 commented Apr 4, 2025

This does the same thing SignalR's ServerSentEventsServerTransport and Blazor's RazorComponentEndpointInvoker does. We didn't catch this before because we test using Kestrel which does not buffer by default.

It's possible to either mock the IHttpResponseBodyFeature or use IIS in integration tests to fully test this fix, but I don't think it's worth the effort right now as I work on other parts of HTTP streaming. I did add test verifying we send the expected headers though.

@halter73 halter73 requested a review from stephentoub April 4, 2025 00:40
@halter73 halter73 changed the title Disable response compression for SSE responses Disable response buffering for SSE responses Apr 4, 2025
@halter73 halter73 merged commit d1a3c20 into modelcontextprotocol:main Apr 4, 2025
8 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