Description
Bug Description
Hi Fiber team,
I’ve noticed two potential issues in the route-parsing logic:
The branch is main. fiber v3.
- Ineffective loop in path.go, func findNextParamPosition:
for found := findNextNonEscapedCharsetPosition(pattern[nextParamPosition+1:], parameterStartChars); found == 0; {
nextParamPosition++
if len(pattern) > nextParamPosition {
break
}
}
The condition if len(pattern) > nextParamPosition { break } appears to render the loop meaningless. Because nextParamPosition is guaranteed to be < len(pattern), the loop will always break after one iteration, which doesn’t seem to match the intended logic of skipping multiple consecutive : or similar parameter characters.
- Route like "/a:::" treated as having a parameter:
If I register GET("/a:::"), tools like Express Route Tester treat it as a purely static route. However, Fiber currently interprets the final : as a parameter indicator. This creates an inconsistency with other routing systems where multiple : characters at the end might be interpreted as part of a static path or simply invalid syntax.
Could you clarify if this is the intended behavior? If not, might it be possible to update the logic in findNextParamPosition (and related parsing code) so that multiple consecutive : are handled more consistently, and routes like "/a:::" are treated as static?
Thank you for your time and for all your work on Fiber!
How to Reproduce
skip
Expected Behavior
skip
Fiber Version
v3 main
Code Snippet (optional)
Checklist:
- I agree to follow Fiber's Code of Conduct.
- I have checked for existing issues that describe my problem prior to opening this one.
- I understand that improperly formatted bug reports may be closed without explanation.