Skip to content

fix: percent-encode track name in expo navigation#328

Merged
MichaelZhao21 merged 2 commits intohackutd:masterfrom
gsonntag:fix/expo-track-url-encoding
Apr 30, 2026
Merged

fix: percent-encode track name in expo navigation#328
MichaelZhao21 merged 2 commits intohackutd:masterfrom
gsonntag:fix/expo-track-url-encoding

Conversation

@gsonntag
Copy link
Copy Markdown
Contributor

@gsonntag gsonntag commented Apr 27, 2026

Description

The expo dropdown built the track URL with t.replace(/\s/g, '%20'), which only escapes spaces. A track name containing a slash (e.g. "AI/ML") got navigated to /expo/AI/ML, which the route /expo/:track interpreted as nested path segments and failed to match. Use encodeURIComponent so spaces, slashes, and any other reserved URL characters survive round-tripping through React Router.

Fixes #315

Type of Change

Delete options that do not apply:

  • Bug fix (change which fixes an issue)

Is this a breaking change?

  • Yes
  • No

The expo dropdown built the track URL with `t.replace(/\s/g, '%20')`,
which only escapes spaces. A track name containing a slash (e.g.
"AI/ML") got navigated to /expo/AI/ML, which the route /expo/:track
interpreted as nested path segments and failed to match. Use
encodeURIComponent so spaces, slashes, and any other reserved URL
characters survive round-tripping through React Router.
@MichaelZhao21 MichaelZhao21 merged commit 38b93a5 into hackutd:master Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] '/' in Track Title Breaks Functionality

2 participants