-
-
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
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Path
loop Search for next param position
Caller->>Path: findNextParamPosition(pattern, nextParamPosition)
Path->>Path: findNextNonEscapedCharsetPosition(subpattern)
alt found != 0
Path-->>Caller: return next param position
else pattern end reached
Path-->>Caller: break loop, return
end
end
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3418 +/- ##
==========================================
- Coverage 83.87% 83.85% -0.02%
==========================================
Files 119 119
Lines 11892 11895 +3
==========================================
+ Hits 9974 9975 +1
- Misses 1488 1489 +1
- Partials 430 431 +1
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.
PR: Fix route parameter parsing logic
Fixes #3289