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

wildcard conflict should panic but doesn't #172

Closed
mbertschler opened this issue Dec 29, 2016 · 2 comments · Fixed by gin-gonic/gin#2163
Closed

wildcard conflict should panic but doesn't #172

mbertschler opened this issue Dec 29, 2016 · 2 comments · Fixed by gin-gonic/gin#2163
Labels
Milestone

Comments

@mbertschler
Copy link

This code panics: panic: catch-all routes are only allowed at the end of the path in path '/api/*rest/two'

router := httprouter.New()
router.GET("/api/*rest/two", handler)
router.GET("/api/*rest", handler)

But this one doesn't.

router := httprouter.New()
router.GET("/api/*rest", handler)
router.GET("/api/*rest/two", handler)

As far as I understand it the router should behave the same in the two cases, or am I missing something?

@julienschmidt
Copy link
Owner

In the second case one of the two routes is unreachable. However, this does not seem to be detected during registration, which is a bug.

@julienschmidt julienschmidt added this to the v1.2 milestone Mar 24, 2017
@julienschmidt julienschmidt modified the milestones: v1.2, v1.3 Oct 13, 2018
@chahat-arora
Copy link

@julienschmidt Hey, any progress on this?

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.

3 participants