Closed arussellsaw closed 5 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Re-opening this as I think it is important to investigate. Thank you for your report @arussellsaw
I can reproduce this. Not sure if we can fix it since it may change routing in backward incompatible ways. I do consider it a bug, but people may rely (even if not knowing it) on this bug to craft their routes by now, which makes it tricky to fix it. @vishr @im-kulikov what are your thoughts?
What if we fix the bug and add a description to the release (docs) that describes the problem? In one of the previous releases of Go changed the json.Unmarshal / Marshal thus breaking backwards compatibility, but described the issue in the release/docs. It was quite normal.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Issue Description
Hi!
i've encountered a bug where the following routes collide and lead to 404 or Method not allowed responses
DELETE /:id/foo/:scheme
PUT /:id/foo/bar
PUT /:id/foo/baz
i've opened a PR with failing tests that reproduce this bug in our framework here: https://github.com/monzo/typhon/pull/103
(direct link to echo-only test here: https://github.com/monzo/typhon/pull/103/files#diff-ed15360a5b63dcacb420fca89f41239cR193 ) thanks! 🙏
Checklist
Expected behaviour
i should be able to call
DELETE /23124/foo/bar
and hit the DELETE handler registeredActual behaviour
i get a Method not allowed response
Steps to reproduce
Working code to debug
https://github.com/monzo/typhon/pull/103
Version/commit