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

Allow matching routes without capturing arguments #27996

Open
davidfowl opened this issue Nov 19, 2020 · 11 comments
Open

Allow matching routes without capturing arguments #27996

davidfowl opened this issue Nov 19, 2020 · 11 comments
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-routing feature-yarp This issue is related to work on yarp Priority:1 Work that is critical for the release, but we could probably ship without
Milestone

Comments

@davidfowl
Copy link
Member

davidfowl commented Nov 19, 2020

For proxy scenarios where routes need to be parameterized for matching but not for capture support a syntax to avoid allocating anything after matching.

e.g.

// ProxyRequest is a made up method that proxies the HttpRequest to another server

endpoints.Map("/api/v1/{*path}", context =>
{
     return context.ProxyRequest("http://localhost/old/" + context.Request.Path);
});

endpoints.Map("/api/v2/{*path}", context =>
{
     return context.ProxyRequest("http://localhost/new/" + context.Request.Path);
});

cc @Tratcher

@Dotnet-GitSync-Bot
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@davidfowl davidfowl transferred this issue from dotnet/runtime Nov 19, 2020
@Tratcher Tratcher added feature-yarp This issue is related to work on yarp area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-routing labels Nov 19, 2020
@Tratcher
Copy link
Member

What do you expect the path for the proxied request to be in this example? /old/api/v1/...?

@davidfowl
Copy link
Member Author

Preserving the entire path.

@javiercn
Copy link
Member

@davidfowl can you give more details?

I'm not sure I understand the E2E

@davidfowl
Copy link
Member Author

davidfowl commented Nov 20, 2020

I host a proxy on localhost:80, then I map all requests to /api/v1/{path} to http://localhost/old/api/v1/{*path}, same for v2. Made it a bit clearer in the description.

I want to avoid the cost of storing captures when I only care about matching because the other server is the one that's going to be doing the matching and parsing.

@mkArtakMSFT mkArtakMSFT added this to the Next sprint planning milestone Nov 20, 2020
@ghost
Copy link

ghost commented Nov 20, 2020

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@mkArtakMSFT mkArtakMSFT added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Nov 20, 2020
@davidfowl
Copy link
Member Author

Do you have an idea of the cost of this @javiercn ?

@javiercn
Copy link
Member

It should be doable, a few days up to a week at most.

  • We would need new syntax for it, but it can already be reflected on the model I think.

@ghost
Copy link

ghost commented Aug 10, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@javiercn javiercn added the jcn-p0 label Nov 5, 2021
@mkArtakMSFT mkArtakMSFT added the Priority:1 Work that is critical for the release, but we could probably ship without label Nov 23, 2021
@mkArtakMSFT mkArtakMSFT modified the milestones: Backlog, .NET 7 Planning Nov 23, 2021
@ghost
Copy link

ghost commented Nov 23, 2021

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@ghost
Copy link

ghost commented Oct 25, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@amcasey amcasey added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-routing feature-yarp This issue is related to work on yarp Priority:1 Work that is critical for the release, but we could probably ship without
Projects
None yet
Development

No branches or pull requests

6 participants