Skip to content
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

fix(ui): Allow Trailing Slashes #19093 #19389

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions ui/src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ requests.setBaseHRef(base);
type Routes = {[path: string]: {component: React.ComponentType<RouteComponentProps<any>>; noLayout?: boolean}};

const routes: Routes = {
'/login': {component: login.component as any, noLayout: true},
'/applications': {component: applications.component},
'/settings': {component: settings.component},
'/user-info': {component: userInfo.component},
'/help': {component: help.component},
'/pkce/verify': {component: PKCEVerification, noLayout: true}
// for removing trailing slash, use regex (/*)? end of the path.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These regexes look too permissive. I've tried in Python and '/login(/*)?' would match anything starting with /login and things like /login// would be a part of the match. Not sure that's intended. Also, why isn't there an update to the logic checking the path? The existing code looks like it doesn't expect the regex but rather a regular string.

'/login(/*)?': {component: login.component as any, noLayout: true},
'/applications(/*)?': {component: applications.component},
'/settings(/*)?': {component: settings.component},
'/user-info(/*)?': {component: userInfo.component},
'/help(/*)?': {component: help.component},
'/pkce/verify(/*)?': {component: PKCEVerification, noLayout: true}
};

interface NavItem {
Expand Down