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

Route parameter with uri-encoded percent sign character (%) causes error in SSR #7374

Closed
1 task
jwulf0 opened this issue Jun 12, 2023 · 1 comment · Fixed by #9532
Closed
1 task

Route parameter with uri-encoded percent sign character (%) causes error in SSR #7374

jwulf0 opened this issue Jun 12, 2023 · 1 comment · Fixed by #9532
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: ssr Related to SSR (scope)

Comments

@jwulf0
Copy link

jwulf0 commented Jun 12, 2023

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 via decodeURIComponent or decodeURI. This causes a string containing a percent sign without two following digits to be provided to the decodeURIComponent function.

Link to Minimal Reproducible Example

https://github.com/jwulf0/astro-uri-decode-bug-minimal

Participation

  • I am willing to submit a pull request for this issue.
@jwulf0
Copy link
Author

jwulf0 commented Jun 12, 2023

Note: Just updated the minimal reproducible example to make it "more minimal".

@jwulf0 jwulf0 changed the title Route parameter with uri-encoded percent sign character (%) causes error Route parameter with uri-encoded percent sign character (%) causes error in SSR Jun 12, 2023
@bholmesdev bholmesdev added the - P3: minor bug An edge case that only affects very specific usage (priority) label Jun 12, 2023
@Princesseuh Princesseuh added the feat: ssr Related to SSR (scope) label Jul 17, 2023
@bluwy bluwy self-assigned this Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: ssr Related to SSR (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants