Skip to content

Overlapping endpoints can be routed ambiguously #131

@Firehed

Description

@Firehed

Relating to #50: if there are two endpoints registered that overlap such that one is a longer version of the other, it's possible for requests to the shorter-named version to get routed to the longer one; e.g. a request to /edit/foo gets routed to the implementation to /edit/foobar. Even more problematic is that this behavior isn't consistent, and is basically at the mercy of whatever order the filesystem returns endpoint files in.

This may be fixable by sorting the routing table when its loaded, though if #51 happens, a different fix may be required. I do not think automatically adding a trailing $ to the internal regex is appropriate, as some users may be relying on the existing "starts with" behavior. That said, endpoints explicitly adding $ to their URI should resolve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions