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

URI template conflicts after router update #535

Closed
ghost opened this issue Apr 28, 2015 · 2 comments · Fixed by #538
Closed

URI template conflicts after router update #535

ghost opened this issue Apr 28, 2015 · 2 comments · Fixed by #538
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Apr 28, 2015

I have been abusing the route order a bit, and would like to know if there is a way to do this with the new router, or if this is actually a bug.

application = falcon.API()
application.add_route('/action1', Action1Handler())
application.add_route('/action2', Action2Handler())
application.add_route('/action3', Action3Handler())
application.add_route('/{action}', ActionFallbackHandler())

I realize this is probably a strange use case, and I could move the top 3 handlers into the bottom one and just relay the requests to the various other handlers, but this way seems cleaner.

@kgriffs kgriffs added this to the 0.3 milestone Apr 30, 2015
@kgriffs kgriffs added the bug label Apr 30, 2015
@kgriffs
Copy link
Member

kgriffs commented Apr 30, 2015

Interesting, thanks for sharing your use case. Let me take a look and see what it would take to support this in the new router, since I'd rather not have a regression in functionality.

@ghost
Copy link
Author

ghost commented Apr 30, 2015

Please see #536

I'm not sure if that introduces some more obscure bug, but the tests pass at least.

kgriffs pushed a commit to kgriffs/falcon that referenced this issue May 1, 2015
1. The order routes are added should not matter
2. Ensure entire path is consumed before returning a matched route

Closes falconry#535
kgriffs pushed a commit that referenced this issue May 8, 2015
1. The order routes are added should not matter
2. Ensure entire path is consumed before returning a matched route

Closes #535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant