fix url encoded desktop assets
This commit is contained in:
1 parent
b476c6e8a7
commit
e03e0647ee
2 files changed
+4
-1
No files matched your search
@@ -38,6 +38,7 @@ slab = "0.4"
|
|||||||
|
|
||||||
futures-util = "0.3.25"
|
futures-util = "0.3.25"
|
||||||
rfd = "0.11.3"
|
rfd = "0.11.3"
|
||||||
|
urlencoding = "2.1.2"
|
||||||
|
|
||||||
[target.'cfg(target_os = "ios")'.dependencies]
|
[target.'cfg(target_os = "ios")'.dependencies]
|
||||||
objc = "0.2.7"
|
objc = "0.2.7"
|
||||||
|
|||||||
@@ -87,7 +87,9 @@ pub(super) fn desktop_handler(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Else, try to serve a file from the filesystem.
|
// Else, try to serve a file from the filesystem.
|
||||||
let path = PathBuf::from(request.uri().path().trim_start_matches('/'));
|
let decoded = urlencoding::decode(request.uri().path().trim_start_matches('/'))
|
||||||
|
.expect("expected URL to be UTF-8 encoded");
|
||||||
|
let path = PathBuf::from(&*decoded);
|
||||||
|
|
||||||
// If the path is relative, we'll try to serve it from the assets directory.
|
// If the path is relative, we'll try to serve it from the assets directory.
|
||||||
let mut asset = get_asset_root()
|
let mut asset = get_asset_root()
|
||||||
|
|||||||
Reference in new issue
Block a user