Catch-all routes don't use Priority 0 by default (despite documentation implying that they do) #1504
Labels
bug
Identified as a potential bug
needs feedback
Issue is waiting on feedback before acceptance
needs validation
Issue has not been replicated or verified yet
proposal
Proposal for a new functionality in Ocelot
Routing
Ocelot feature: Routing
Expected Behavior
Refer to this part in the documentation:
Based on this information, I assumed that I could omit the "Priority" option on catch-all routes (because it's hard-coded to be zero, right?) and that route matching would work identically to if I had explicitly set the priority to 0.
Given the configuration shown below, therefore, I would expect the route
/api/test/hello
not to resolve the catch-all route. I expect this because I explicitly set the second (non-catch-all) route to have a Priority of 1, so it should take priority.Actual Behavior
Given the above example configuration, the route
/api/test/hello
does match on the catch-all route for some reason. This is not what I expected after reading the documentation, since I would expect the first route (the catch-all) to have a Priority of 0, and the second to have a Priority of 1.Once I add
"Priority": 0
to the catch-all route, however, the Priority feature seems to begin operating as expected, and/api/test/hello
resolves to the non-catch-all route.So, it seems that either the default priority for catch-all routes is not zero, or that some other issue is at play.
It would be good if either the documentation was updated to clarify this point, or if the routing behavior was updated to match the behavior implied by the documentation.
Steps to Reproduce the Problem
http://localhost:5000/api/test/hello
; this is the catch-all route, and returns the argument 'hello'."Priority": 0
to the catch-all route inocelot.json
.http://localhost:5000/api/test/hello
. Notice that the non-catch-all route is now being resolved.Specifications
The text was updated successfully, but these errors were encountered: