Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get EmptyHttpResult in RDF via reflection (#45878) #46048

Merged
merged 2 commits into from Jan 12, 2023

Conversation

captainsafia
Copy link
Member

@captainsafia captainsafia commented Jan 12, 2023

Backport of #45878 to release/7.0.

Description

This PR updates the RequestDelegateFactory to access the EmptyHttpResult type via reflection instead of defining and emitting its own EmptyHttpResult as part of the runtime code generation.

Fixes #45063

Customer Impact

Without this change, users cannot adequately write test cases for applications that leverage filters and happen to return an empty result because the internal EmptyHttpResult was not public to assert on. This change provides a quality of life improvement and allows users to write more complete test cases for their applications.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Low risk because the surface area of the change is small (minimal APIs with endpoint filters).

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

* Get EmptyHttpResult in RDF via reflection

* Always use instance property for checks

* Favor Debug.Assert instead of early exception

* Throw exception in RELEASE builds

* Fix ifdef
@captainsafia
Copy link
Member Author

Approved via email.

@captainsafia captainsafia added the Servicing-approved Shiproom has approved the issue label Jan 12, 2023
@ghost
Copy link

ghost commented Jan 12, 2023

Hi @captainsafia. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

@dougbu dougbu merged commit 65330ff into release/7.0 Jan 12, 2023
@dougbu dougbu deleted the bp-emptyhttprequest branch January 12, 2023 19:37
@dougbu dougbu added this to the 7.0.3 milestone Jan 20, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 25, 2023
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 Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants