Add X-Accel-Buffering header to SSE responses (#1294)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
This commit is contained in:
Copilot 2026-02-17 16:03:10 -05:00 • committed by GitHub
commit 2e17550303
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -339,6 +339,7 @@ internal sealed class StreamableHttpHandler(
// Make sure we disable all response buffering for SSE.
context.Response.Headers.ContentEncoding = "identity";
context.Response.Headers["X-Accel-Buffering"] = "no";
context.Features.GetRequiredFeature<IHttpResponseBodyFeature>().DisableBuffering();
}