-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
🐛 fix: Handling of next param position #3418
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
base: main
Are you sure you want to change the base?
🐛 fix: Handling of next param position #3418
Conversation
Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
""" WalkthroughThe changes update the logic within the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@KatzuYoru What issue is this related to? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3418 +/- ##
==========================================
+ Coverage 83.87% 83.94% +0.07%
==========================================
Files 119 119
Lines 11892 11898 +6
==========================================
+ Hits 9974 9988 +14
+ Misses 1488 1482 -6
+ Partials 430 428 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR fixes the route parameter parsing by addressing an infinite loop in findNextParamPosition and correcting boundary checks to prevent index-out-of-range issues. Key changes include:
- Replacing the for-loop initializer with an infinite loop that recalculates the found variable on each iteration.
- Updating the boundary check condition from "if len(pattern) > nextParamPosition" to "if len(pattern) <= nextParamPosition+1" for better index safety.
Co-authored-by: Copilot <[email protected]>
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.
Please run the tests before submitting a PR—see make test
and other targets in the Makefile. Also, make sure to update tests where necessary.
sir the tests for path.go are passing now locally, how to check the test and coverage here? |
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.
Pull Request Overview
This PR fixes an infinite loop in the findNextParamPosition function by recalculating parameter start positions on each iteration. It also corrects the boundary check to avoid index out-of-range errors and improves the treatment of consecutive parameter indicators.
- Fixed infinite loop in findNextParamPosition
- Corrected boundary check for parameter clusters
- Improved handling of consecutive parameter indicators
@KatzuYoru Check the linter failure. |
Co-authored-by: Copilot <[email protected]>
PR: Fix route parameter parsing logic
Fixes #3289