-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Path parsing issue #366
Comments
hmmm. Maye you have a typo here? I can't tell different between your to sample requests you provide.
and
Appear to be the same. |
Apologies, typo indeed. Corrected |
Good issue for people not coming from a Go background, we should definitely tackle this. That is expected from the Go 1.22 default router. You can see by yourself on this Go playground I set up for you.
That being said, what can we do with Fuego?
My suggestion : 3️⃣ I think that current behaviour is expected for gophers and make sense. I don't want to dive into routing, I want to rely heavily on Go's defaults We can add an option for 1️⃣ (that should be deactivated by default to keep Fuego's philosophy in mind), a bit like chi's middleware RedirectSlashes or StripSlashes. But if we do 1️⃣, requests like |
Could I take a shot at this? |
Could I try solving this? |
Well, as spec is not really well defined, please state what you'll be doing first. If you're going for what I've suggested in my previous comment, just know that Fuego's team might make a lot of comments and it might not be merged at all, depending on if we're happy with what is proposed :) So no guarantee of it being merged in the end :) |
Would love to tackle this! I’m an experienced full-stack developer with strong expertise in Golang and building robust APIs. I’d like to help resolve this routing issue by investigating how Fuego handles trailing slashes in route definitions. I will ensure that the behavior is consistent for routes like /book/{id} and /book/{id}/ to correctly map to the intended handlers. Looking forward to contributing and improving the framework! |
am a developer specializing in Golang API development, I'm eager to address the trailing slash routing challenge. This is a common issue in Go web frameworks, and I'll focus on implementing a consistent solution for Fuego's route handling. By examining how routes like /book/{id} are processed, we can ensure proper handler mapping regardless of trailing slashes. I'm committed to enhancing Fuego's routing functionality while maintaining its idiomatic Go approach |
Hello I am Fab a full stack engineer that has contributed to Go web3 projects in the past like https://github.com/concrete-eth/concrete-geth. I would love to address this issue by fixing the path parsing issue |
to my knowledge a URL is equivalent to the same URL + "/" (this implies any number of trailing slashes). |
Is my solution with ideas 2️⃣ and 3️⃣ OK for you @Seemone ? |
you mean 1 and 2? in that case yes. An option to strip trailing slashes (default false) seems sensible to me. Personally I don't find "" routes weird |
Yes sorry, I meant 1 and 2. I found that declaring Proof of concept what do you think @dylanhitt? @NueloSE you didn't reply and the issue is currently assigned to you, what is your personal opinion? |
Yes that is fine. I'm for it. |
To Reproduce
Steps to reproduce the behavior:
when creating routes like this
requests like
GET http://localhost:9999/book/43/
are routed to
rs.getAllBook
instead ofrs.getBook
while requests likeGET http://localhost:9999/book/43
are correctly routed to
rs.getBook
Versions
Go v1.23.5
Fuego v0.17.0
The text was updated successfully, but these errors were encountered: