-
Notifications
You must be signed in to change notification settings - Fork 389
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
feat(mux): add wildcard (*) for more flexible route matching #3631
base: master
Are you sure you want to change the base?
Conversation
ErrHandlerFunc ref :GetVar
🛠 PR Checks Summary🔴 Pending initial approval by a review team member, or review from tech-staff Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. But I left a comment, so please check it out.
default: | ||
// continue | ||
if handlerPart != reqParts[reqIndex] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems need to check boundary before accessing reqParts
.
For example, when the request path is /foo/bar
and the handler path is /foo/bar/baz
handlerParts = ["foo", "bar", "baz"]
reqParts = ["foo", "bar"]
Accessing index 2 (reqParts[2]
) will result in a runtime error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback, i fixed this issue in 73241a7
This pull request is for add some TODOs in
p/demo/mux
:Basic example: