Closed onionhammer closed 2 months ago
@onionhammer thanks for contacting us.
This is by design. Routing evaluates the current path against all potential matches as a first step and then applies matcher policies and ordering to get a final result.
/tiles/{**path}
might not match because it has an HTTP POST constraint and, in that case, /tiles/sample.js
will still match and can't be discarded.
Why was the choice made to not just route to a more specific path?
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.
See our Issue Management Policies for more information.
Is there an existing issue for this?
Describe the bug
Using a {parameter} in one route and a {*catchall} in another route causes a RouteHandlers to be invoked unrelated requests
Example:
the
my_route_constraint
will be invoked with "tiles" as the routeKey value ofpartner
even though the path is not using that constraint, and is more specific (starts with /tiles/) for certain requestsexample:
Expected Behavior
If you specify a prefixed route, it should not hit a route constraint?
Steps To Reproduce
Here is a repo that reproduces the issue:
https://github.com/onionhammer/repro-routing-issue/blob/master/Program.cs
Reference test.http for example requests
Exceptions (if any)
No response
.NET Version
8.0.401
Anything else?
No response