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 params sometimes being double-decoded #778

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Conversation

bakerkretzmar
Copy link
Collaborator

Calling decodeURI before we try to match params allows us to handle Cyrillic characters, but it decodes other characters too, which means decodeURIComponent a few lines later tries to decode them again. I think this actually doesn't matter for most characters, but % specifically causes problems because it can't be decoded again on its own.

I'm not positive that this solution works perfectly, if it causes other issues I might tweak how we support Cyrillic characters. Cyrillic characters are only decoded for display, in location.href and other JavaScript stuff they're kept encoded so we might need to do that too.

Fixes #777.

@bakerkretzmar bakerkretzmar self-assigned this Oct 17, 2024
@bakerkretzmar bakerkretzmar merged commit 5b3b84a into 2.x Oct 17, 2024
22 checks passed
@bakerkretzmar bakerkretzmar deleted the fix-percent-in-param branch October 17, 2024 15:17
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.

Percent sign in URL results in a URI malformed error when using route().current()
1 participant