-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
MapHost endpoint routing #19354
Comments
@Tratcher can you add a bit more info here? What is the scenario you have in mind.
|
We had some discussion offline before this issue was created. I think the key points are:
The proxy wants this, because it's a fairly common thing for proxies to route traffic solely on host. The behavior would be the same as a catch-all route.
We should add support for unnamed route parameters (or optionally I haven't totally made up my mind yet whether I think a route with unnamed parameters should support link generation, or whether unnamed route parameters can be optional. The ability to control capturing and matching separately is really nice. There's a big difference when a route has parameters vs when it don't be. https://github.com/dotnet/aspnetcore/blob/master/src/Http/Routing/src/Matching/DfaMatcher.cs#L115 - routes with parameters allocate a A route without parameters doesn't allocate anything during matching. An RVD is allocated only if someone tries to access it - and they likely won't for the proxy case. The option of supporting |
For reference, this is how the proxy builds routes today: |
@Tratcher do you want to tackle this? |
We're not blocked by this at the moment, but we'll see how the perf benchmarks work out. |
Thanks for contacting us. We're moving this issue to the |
Thanks for contacting us. We're moving this issue to the |
Describe the bug
In endpoint routing today routes are defined around paths. There's an additional constraint you can add for a host, but only after already defining a path. Instead what I want to do is map all requests to a specific host as the primary pivot. This can be done today but it is inelegant (I have to define a catch-all route), and in-efficient (route values would still be extracted).
To Reproduce
Here's what I have to write today:
Proposal:
The text was updated successfully, but these errors were encountered: