Skip to content

How to route when use {Literals} at last? #2095

Answered by raman-m
adelvadia asked this question in Q&A
Discussion options

You must be logged in to vote

I can resolve this issue by specifying high priority to second one. Here, I expect best match instead of first match.
Is there any solution to do so?

Yes, There is!


Above GET request matches first route instead of second one.

Indeed, the GET request matches the first route rather than the second one because the first route is a Catch All route. A Catch All route is a unique type of routing that attempts to match all content in the last placeholder, including query strings.
I believe that when multiple routes match a URL, the first one is selected.


I can resolve this issue by specifying high priority to second one.

Certainly, this is the correct solution. Prioritizing routing is ne…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by raman-m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Routing Ocelot feature: Routing
2 participants
Converted from issue

This discussion was converted from issue #2092 on June 12, 2024 10:19.