Skip to content

Revert "Pass RequestAborted cancellation token to WriteAsJsonAsync in DefaultProblemDetailsWriter"#66811

Open
Youssef1313 wants to merge 1 commit into
mainfrom
revert-66606-copilot/fix-defaultproblemdetailswriter-cancellation-token
Open

Revert "Pass RequestAborted cancellation token to WriteAsJsonAsync in DefaultProblemDetailsWriter"#66811
Youssef1313 wants to merge 1 commit into
mainfrom
revert-66606-copilot/fix-defaultproblemdetailswriter-cancellation-token

Conversation

@Youssef1313
Copy link
Copy Markdown
Member

Reverts #66606

See post-merge discussions of initial PR #66606 (comment)

Copilot AI review requested due to automatic review settings May 23, 2026 10:26
@Youssef1313 Youssef1313 enabled auto-merge (squash) May 23, 2026 10:26
@github-actions github-actions Bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label May 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reverts the earlier change that forwarded HttpContext.RequestAborted into DefaultProblemDetailsWriter.WriteAsync()’s WriteAsJsonAsync(...) call, restoring the previous cancellation/exception behavior for problem details responses.

Changes:

  • Remove cancellationToken: httpContext.RequestAborted from DefaultProblemDetailsWriter.WriteAsync().
  • Remove the unit test that asserted WriteAsync throws when cancellation is already requested.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Http/Http.Extensions/src/DefaultProblemDetailsWriter.cs Reverts passing RequestAborted into WriteAsJsonAsync, restoring prior cancellation/throw behavior.
src/Http/Http.Extensions/test/ProblemDetailsDefaultWriterTest.cs Removes the cancellation-focused regression test added for the reverted behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants