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

Mixed params and exact paths after last slash can cause a 404 #2799

Closed
VincentYe123 opened this issue Jul 30, 2021 · 6 comments · Fixed by #2802
Closed

Mixed params and exact paths after last slash can cause a 404 #2799

VincentYe123 opened this issue Jul 30, 2021 · 6 comments · Fixed by #2802

Comments

@VincentYe123
Copy link

We have three routers, as following

Router1 "/get/:id"
Router2 "/get/user_info"
Router3 "/get/uuid"

We test these three routers with some requests:
/get/aID -> Router1
/get/user_info -> Router2
/get/uuid -> Router3

/get/uID -> 404(Expect Router1)
So, if there are some param starts with the prefix 'u' in this example, it will not get the right router.

Environment

  • go version:1.16.3
  • gin version (or commit ref):1.7.2
  • operating system:macOS
@wxning1107
Copy link

+1

@qm012
Copy link
Contributor

qm012 commented Aug 2, 2021

#2796 has fixed this bug
@appleboy @thinkerou Do we need to release a new minor version (1.7.3)

@qm012
Copy link
Contributor

qm012 commented Aug 2, 2021

@wxning1107 @VincentYe123 Use the latest code to see if you have fixed the problem

go get -u github.com/gin-gonic/gin@master

@appleboy
Copy link
Member

appleboy commented Aug 3, 2021

@qm012 Yes, I will bump the new version v1.7.3

@appleboy
Copy link
Member

appleboy commented Aug 3, 2021

See https://github.com/gin-gonic/gin/releases/tag/v1.7.3

@wxning1107
Copy link

thx

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 a pull request may close this issue.

4 participants