Skip to content

Ambiguous route matching between /test/:param1/test and /test/:param1/:param2 #429

@Dzyszla

Description

@Dzyszla

I'm encountering an issue with ambiguous route matching in Horse.

I have two routes defined:

THorse.Get('/test/:param1/test', HandleSpecific);
THorse.Get('/test/:param1/:param2', HandleGeneric);

When I send a request to /test/123/test, it is handled by the second (more generic) route, /test/:param1/:param2, instead of the more specific /test/:param1/test.

I would expect the router to prefer the more specific match when available. Is there any way to configure the routing system to prioritize more specific paths, or to support route specificity?

If this is not currently supported, would you consider this as a potential feature? Maybe RegEx for param values?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions