decodeURI happening twice on a request causing server to crash #13298
Labels
- P4: important
Violate documented behavior or significantly impacts performance (priority)
feat: routing
Related to Astro routing (scope)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When a request comes, the pathname is decoded and set in vite-plugin-astro-server/request.ts
but then in routing/match.ts -> matchAllRoutes we try to decode the uri again for some reason
this double decoding will break on routes such as:
original uri -
/d/_'%22()&%25%3Czzz%3E%3CScRiPt%20%3EjEUh(9725)%3C%2fScRiPt%3E_4pGyF4moGuWlju5fyPal9rk6Zu7C8E77dNJetF_tSY0
decodeURI result -
/d/_'"()&%<zzz><ScRiPt >jEUh(9725)<%2fScRiPt>_4pGyF4moGuWlju5fyPal9rk6Zu7C8E77dNJetF_tSY0
which if you try to decode again throws an error
Log:
What's the expected result?
The decode uri happens once and no error is emitted
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-gwdsqj
Participation
The text was updated successfully, but these errors were encountered: