Route parameter with uri-encoded percent sign character (%) causes error in SSR #7374
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
feat: ssr
Related to SSR (scope)
What version of
astro
are you using?2.6.3
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Firefox (the problem is with SSR though)
Describe the Bug
When calling a path with an uri-encoded route parameter which contains the
%
character, an error is rendered instead of the expected page. Please see the repo with minimal reproducable example for more details.I would expect to be able to provide such a route parameter as long as it's properly URI-encoded. Please let me know if I am wrong to expect that.
Looking at the stack trace and following the code, I am rather sure that this is caused by
decodeURIComponent
being called with a value that has been previously decoded viadecodeURIComponent
ordecodeURI
. This causes a string containing a percent sign without two following digits to be provided to thedecodeURIComponent
function.Link to Minimal Reproducible Example
https://github.com/jwulf0/astro-uri-decode-bug-minimal
Participation
The text was updated successfully, but these errors were encountered: