Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlapping endpoints can be routed ambiguously #131

Open
Firehed opened this issue Sep 9, 2021 · 0 comments
Open

Overlapping endpoints can be routed ambiguously #131

Firehed opened this issue Sep 9, 2021 · 0 comments
Labels

Comments

@Firehed
Copy link
Owner

Firehed commented Sep 9, 2021

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.

@Firehed Firehed added the bug label Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant