-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Problem
The router does not parse + as space in query string. This is because the router will never put the + there, only %20. But other websites and services will change that %20 into + in the URL when they process URLs, for example facebook products.
Steps To Reproduce
Steps to reproduce the behavior:
- make app with router with query string route like
?:q
#[derive(Debug, Clone, Routable, PartialEq)]
#[rustfmt::skip]
pub enum Route {
#[layout(Navbar)]
#[route("/?:query")]
Home {query: String},
}-
navigate to page with space in q, for example query=
Shis Kebap= https://dj-vaslui.alt-f4.ro/?query=Shis%20Kebap -
copy/paste above URL into facebook messenger
-
click the processed URL from facebook messenger
-
Zuck will do MITM redirects on the URL and change it into https://dj-vaslui.alt-f4.ro/?query=Shis+Kebap and thus save on 2 bytes
-
dioxus router fails to parse the
+asas per the URL spec, and my query string is now query=Shis+Kebap
Expected behavior
Router should parse + as as per URL spec, even if it never put the + there itself.
https://en.wikipedia.org/wiki/Query_string#URL_encoding
Screenshots
before zuck
after zuck
Environment:
- Dioxus version: 0.7.3
- Rust version: 1.93
- OS info: debian 11 on docker
- App platform: web
Questionnaire