Skip to content

StreamOutputFormatter doesn't react to client disconnect #65493

Description

@mus65

Is there an existing issue for this?

  • 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:

await valueAsStream.CopyToAsync(response.Body);

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

Activity

  1. added
    area-networking
    on Feb 20, 2026
  2. added a commit that references this issue on Mar 15, 2026
    4fa6a8a
  3. added a commit that references this issue on Mar 22, 2026
    3599c89
  4. added a commit that references this issue on Apr 21, 2026
    90e97cf
  5. added theissue type on Aug 19, 2026
  6. added
    area-mvc
    and removed
    area-networking
    on Aug 19, 2026
  7. added
    bug
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-mvcbug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions