Merge pull request #1039 from Demonthos/fix-url-encoded-assets

Fix URL encoded desktop assets
This commit is contained in:
Jon Kelley authored and GitHub committed 2023-05-29 14:56:35 +02:00
commit 9e4d32a9c2
2 files changed
+4 -1

No files matched your search

+3 -1
View File
@@ -87,7 +87,9 @@ pub(super) fn desktop_handler(
}
// 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.
let mut asset = get_asset_root()