| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Without this header, reverse proxies like Nginx buffer SSE responses by default, delaying delivery of streamed content instead of forwarding it in real time. Adds the header to all three SSE-producing response paths in the servlet-based SSE and streamable HTTP transports. Fixes modelcontextprotocol#293
Covers all three response paths that open an SSE stream: the legacy SSE transport's GET endpoint, the streamable transport's GET listening stream, and the streamable transport's POST tool-call response. Verified each test fails without the header and passes with it.
|
Without this fix stream is not working in AWS API Gateway where backend proxy is ngingx |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Fixes #293.
None of the servlet-based SSE responses set X-Accel-Buffering: no. Without it, reverse proxies like Nginx buffer the response by default, batching what should be a real-time stream of JSON-RPC messages/notifications instead of forwarding each one as it's written.
Changes
Added the header alongside the existing Cache-Control/Connection headers at all three places an SSE response is opened:
Tests
Added one integration test per call site above, each opening a real connection through a real Tomcat instance and asserting X-Accel-Buffering: no is present on the response. I verified all three fail without the header and pass with it (reverted the header lines locally, confirmed the exact assertion failures, then restored the fix).
Verification
Related PR
#848 proposed the same header addition (2 of the 3 sites) but appears to have gone stale without review. This PR covers all three SSE response sites and adds test coverage.