Avoid passing redirect_base parameters to URL#619
Conversation
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughRefactored OAuth redirect URI construction in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
942bca3 to
dd7bb62
Compare
|
@ori-amizur Could you please re-approve? For some reason the rebase affected the approval. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
proxy/auth/redirect.go (1)
38-39: Consider usingurl.PathEscapedirectly.Creating a
url.URLobject solely to callEscapedPath()works correctly but is slightly indirect. You could simplify to:- pathURL := &url.URL{Path: callbackPath} - return scheme + "://" + host + pathURL.EscapedPath(), nil + return scheme + "://" + host + url.PathEscape(callbackPath), nilHowever, the current approach is more explicit about intent and equally correct.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@proxy/auth/redirect.go` around lines 38 - 39, Replace the indirect creation of a url.URL just to call EscapedPath(): instead of constructing pathURL := &url.URL{Path: callbackPath} and returning pathURL.EscapedPath(), call url.PathEscape(callbackPath) directly where the return builds the redirect (the same expression that currently returns scheme + "://" + host + pathURL.EscapedPath()); update that return to use url.PathEscape(callbackPath) and remove the unnecessary pathURL variable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@proxy/auth/redirect.go`:
- Around line 38-39: Replace the indirect creation of a url.URL just to call
EscapedPath(): instead of constructing pathURL := &url.URL{Path: callbackPath}
and returning pathURL.EscapedPath(), call url.PathEscape(callbackPath) directly
where the return builds the redirect (the same expression that currently returns
scheme + "://" + host + pathURL.EscapedPath()); update that return to use
url.PathEscape(callbackPath) and remove the unnecessary pathURL variable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 34cf2990-e8c8-4be2-8802-23a8f7ebc299
📒 Files selected for processing (1)
proxy/auth/redirect.go
dd7bb62 to
4b92d0f
Compare
These seem false positives from
snyk, but it's best to get them solved.Summary by CodeRabbit