StreamOutputFormatter doesn't react to client disconnect
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
We have a controller action returning a stream and had a HTTP request hanging here after the client had already disconnected:
https://github.com/dotnet/aspnetcore/blob/e742462cfbe457e627ad95a9d47e90d8372e43cb/src/Mvc/Mvc.Core/src/Formatters/StreamOutputFormatter.cs#L40
I assume this is missing `context.HttpContext.RequestAborted` as a `cancellationToken`.
I could make a PR (or feel free to assign it to Copilot).
### Expected Behavior
Request should abort when client disconnects.
### Steps To Reproduce
_No response_
### Exceptions (if any)
_No response_
### .NET Version
.NET 10.0.3
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.