Commit Graph

14 Commits

Author SHA1 Message Date
N. Taylor Mullen 4f6022323b Revert "Fix endpoint routing statefulness."
This reverts commit 9a6881b0e8.
2019-08-13 13:27:36 -07:00
N. Taylor Mullen 44431151c7 Revert "Addressed code review comments."
This reverts commit 479d5ed40a.
2019-08-13 13:27:36 -07:00
N. Taylor Mullen 18391dd2e4 Revert "Clear route values after middleware invocation."
This reverts commit c54a7209d7.
2019-08-13 13:27:36 -07:00
N. Taylor Mullen c54a7209d7 Clear route values after middleware invocation.
#11233
2019-07-24 14:12:06 -07:00
N. Taylor Mullen 479d5ed40a Addressed code review comments. 2019-07-24 14:12:06 -07:00
N. Taylor Mullen 9a6881b0e8 Fix endpoint routing statefulness.
- In the case that other middleware change the path of an `HttpContext` and cause middleware to re-invoke we used to short-circuit on second time through the middleware pipeline, now we allow routing to occur.
- Added unit tests to validate the clearing of state.

#11233
2019-07-24 14:12:06 -07:00
David Fowler d3640d59a2
Add a diagnostic source event that fires when a route is matched (#11685)
* Add a diagnostic source event that fires when a route is matched
- Usually more information becomes available about a request once route is matched. This event shoud allow diagnositc systems to enlighten the typical "begin request" metadata to include more information about the matched route and more importantly the selected endpoint and associated metadata.

* Update src/Http/Routing/test/UnitTests/EndpointRoutingMiddlewareTest.cs

Co-Authored-By: campersau <buchholz.bastian@googlemail.com>

* PR feedback and test fixes
2019-07-01 00:13:37 -07:00
Ryan Nowak 24784d0681 Fix #10066 2019-05-09 13:44:16 -07:00
David Fowler 0d77594d17
Make endpoint routing allocation free in common scenarios (#9774)
- This change tries to remove the EndpointSelectoContext allocation by making it a wrapper struct over the HttpContext. Unlike before, the HttpContext gets mutated once any component in the routnig pipeline sets a non null endpoint. This used to happen after the processing was complete.
- This change also implements the IRouteValuesFeature and IEndpointFeature in HttpProtocol to avoid the feature allocation and feature collection version churn.
- We also set the IRouteValuesFeature in IRouter based scenarios.
- Since we're not implementing IRoutingFeature in endpoint routing anymore
we can just create the RouteData inside MVC. We do this by polyfilling RouteData when using endpoint routing inside of MVC
- Implement GetRouteValue in terms of IRouteValuesFeature
- Noop if the EndpointRoutingMiddleware if an endpoint is already set
- Added tests
2019-04-28 21:29:08 -07:00
David Fowler b2457d25f7 Revert "Make endpoint routing allocation free in common scenarios"
This reverts commit 264ae1acd1.
2019-04-26 02:10:25 -07:00
David Fowler 264ae1acd1 Make endpoint routing allocation free in common scenarios
- This change tries to remove the EndpointSelectoContext allocation by making it a wrapper struct over the HttpContext. Unlike before, the HttpContext gets mutated once any component in the routnig pipeline sets a non null endpoint. This used to happen after the processing was complete.
- This change also implements the IRouteValuesFeature and IEndpointFeature in HttpProtocol to avoid the feature allocation and feature collection version churn.
2019-04-26 02:08:53 -07:00
Ryan Nowak 658b37d2bd
Make UseEndpoints a thing (#8765)
* Make endpoint middleware explicit

This change makes the endpoint middleware explicit again, and updates
all of the templates.

The other change here is make UseEndpoints be the place where you
register endpoints. This is vital because it puts your code visually at
the point of the pipeline where it executes.

Lastly, I removed support for UseMvc with endpoint routing. This is
causing issues for some security features, and we're moving in the
direction of trying to make the middleware heavy implementation required
in 3.0. There are some issues we won't be able to fix in MVC if we can't
unambiguously know if UseMvc was used or the middleware.
2019-03-28 15:41:11 -07:00
Nate McMaster 85e2147ff0
Merge branch 'release/2.2' 2018-12-07 11:11:44 -08:00
Nate McMaster 569a14ecb8
Merge branch 'release/2.1' into release/2.2 2018-12-06 17:09:03 -08:00