Fix url encoding query and implement FromQueryArgument for Option<T> (#4213)

* Fix url encoding queries

* handle percent encoding hash fragments

* implement fromqueryargument for Option<T>

* fix tests

* fix typo
This commit is contained in:
Evan Almloff authored and GitHub committed 2025-06-02 13:14:53 -05:00
1 parent 662cf0d902
commit 9b16cbf254
13 files changed
+294 -30

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ rust-version = "1.79.0"
[dependencies]
http = { workspace = true }
urlencoding = { workspace = true }
percent-encoding = { workspace = true }
infer = { workspace = true }
thiserror = { workspace = true }
dioxus-cli-config = { workspace = true }
+2 -1
View File
@@ -18,7 +18,8 @@ pub fn serve_asset_from_raw_path(path: &str) -> Result<Response<Vec<u8>>, AssetS
// If the user provided a custom asset handler, then call it and return the response if the request was handled.
// The path is the first part of the URI, so we need to trim the leading slash.
let mut uri_path = PathBuf::from(
urlencoding::decode(path)
percent_encoding::percent_decode_str(path)
.decode_utf8()
.expect("expected URL to be UTF-8 encoded")
.as_ref(),
);