R2
"Issue Handling Query Parameters with Slashes (/) in SolidStart URLs".
"I’m building a SolidStart application, and I’m encountering an issue with handling URLs that contain query parameters with slashes (/) in their values. For example:
http://localhost:3000/organizations/45 works perfectly because it uses path-based routing.
http://localhost:3000/organizations?o=1/45 does not work as expected since this is exactly what i want.
It seems like the / in the query parameter ?o=1/45 is being interpreted as part of the path instead of part of the query string.the url gets updated in the url search bar of my browser but the page does not update.
- I tried encoding the / in the query parameter as %2F, so the URL becomes http://localhost:3000/organizations?o=1%2F45. However, this still doesn’t work.
-I experimented with replacing / with other characters like - or :, and these work. However, I want to understand why the slash causes issues and how to fix it without changing the parameter format if possible.
I expect http://localhost:3000/organizations?o=1/45 to work without breaking routing or query parameter handling.
3 replies