Stop double encoding in the URL
Also stop encoding @. This will make URLs more readable.
Consistently don't encode /. This was enabled by earlier changes that
make sure that all route pattern are regular expressions. The special
:param matching of page.js did not work with `/` chars.
Release-Notes: skip
Change-Id: I15f864505811fa2c04cfb5bbb00b643464f40f3c
diff --git a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
index 94467b5..a841958 100644
--- a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
+++ b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
@@ -35,6 +35,7 @@
import {fireAlert, firePageError} from '../../../utils/event-util';
import {windowLocationReload} from '../../../utils/dom-util';
import {
+ encodeURL,
getBaseUrl,
PatchRangeParams,
toPath,
@@ -969,7 +970,7 @@
if (ctx.params[0].toLowerCase() === 'self') {
this.redirectToLogin(ctx.canonicalPath);
} else {
- this.redirect('/q/owner:' + encodeURIComponent(ctx.params[0]));
+ this.redirect('/q/owner:' + encodeURL(ctx.params[0]));
}
} else {
const state: DashboardViewState = {
@@ -1275,7 +1276,7 @@
}
handleChangeNumberLegacyRoute(ctx: PageContext) {
- this.redirect('/c/' + encodeURIComponent(ctx.params[0]));
+ this.redirect('/c/' + ctx.params[0]);
}
handleChangeRoute(ctx: PageContext) {
@@ -1578,9 +1579,7 @@
}
handleDocumentationSearchRedirectRoute(ctx: PageContext) {
- this.redirect(
- '/Documentation/q/filter:' + encodeURIComponent(ctx.params[0])
- );
+ this.redirect('/Documentation/q/filter:' + encodeURL(ctx.params[0]));
}
handleDocumentationRedirectRoute(ctx: PageContext) {