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

Add test for duplicate path url but different methods #44

Closed
wants to merge 1 commit into from

Conversation

robd003
Copy link

@robd003 robd003 commented Jun 28, 2021

Test for issue #43

Copy link
Member

@ahopkins ahopkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this. Test looks good, just one small change.

router.add("/<foo:path>", handler2, methods=["POST"])
router.finalize()

_, handler, params = router.get("/a-random-path", "GET")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're doing path, can you make the test /a/random/path? Or perhaps even better, maybe parametrize the test and do both a single and multi segment path.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahopkins Just pushed an update. Let me know if it works for you.

@robd003 robd003 force-pushed the catch-path-route-error branch from 9daa016 to 922d571 Compare June 29, 2021 15:32
@robd003
Copy link
Author

robd003 commented Jun 29, 2021

For the routes is it worth marking which methods they support and then when searching for paths to limit the search for current method only?

In the test case above I was seeing a matcher overtake an even though the wasn't supposed to respond for the method being requested.

@ahopkins
Copy link
Member

I am not sure I understand the question. The issue is (as you said) that the last route definition is taking priority for the methods

@ahopkins
Copy link
Member

ahopkins commented Jul 1, 2021

Replaced by #45

@ahopkins ahopkins closed this Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants