Repository navigation
Return 204 No Content from POST /proxy/mockRequest - #1991
Open
waldekmastykarz wants to merge 1 commit into
Open
waldekmastykarz wants to merge 1 commit into
waldekmastykarz wants to merge 1 commit into
Conversation
The mock request has already been processed when the response is sent, so 202 Accepted is misleading. Closes dotnet#1972 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 250031cc-f525-4369-a32a-0bd181e6f66a
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused change matches the expected behavior with no blocking issues identified; tests were not executed.
No open issues 🎉
What changed in this PR
Updates POST /proxy/mockRequest to return 204 No Content after processing completes, addressing #1972.
Changes:
- Replaces
202 AcceptedwithNoContent()while preserving awaited processing. - Adds a unit test checking the result type and mock-request call count.
Clients expecting exactly 202 must accept 204; the API documentation needs a matching update.
| File | Description |
|---|---|
| DevProxy/ApiControllers/ProxyController.cs | Returns 204 after the mock request completes. |
| DevProxy.Tests/ProxyControllerTests.cs | Adds regression coverage for the controller response. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1972
POST /proxy/mockRequestawaited the mock request and then returned202 Accepted, even though the work was already done. It now returns204 No Content.Breaking change: clients that check for exactly 202 need to accept 204. The API docs (proxy-api.md) need a matching update.
Adds a unit test for
ProxyController.RaiseMockRequestAsync.