bito-code-review[bot] commented on code in PR #40546:
URL: https://github.com/apache/superset/pull/40546#discussion_r3329029911
##########
superset-frontend/src/utils/navigationUtils.ts:
##########
@@ -25,9 +26,9 @@ export const navigateTo = (
if (options?.newWindow) {
window.open(ensureAppRoot(url), '_blank', 'noopener noreferrer');
} else if (options?.assign) {
- window.location.assign(ensureAppRoot(url));
+ window.location.assign(sanitizeUrl(ensureAppRoot(url)));
} else {
- window.location.href = ensureAppRoot(url);
+ window.location.href = sanitizeUrl(ensureAppRoot(url));
}
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Inconsistent sanitization across paths</b></div>
<div id="fix">
The PR adds `sanitizeUrl` to the `assign` and `href` branches but not to
`newWindow`. This creates inconsistent behavior where the same URL succeeds in
one branch and fails or behaves differently in another. Callers cannot predict
behavior without knowing which option was used.
</div>
</div>
<small><i>Code Review Run #2bfc03</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]