From ada24e7c4eb96a9bf6ae2d1a9fdf1a77af0aa2c0 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 3 Jan 2022 19:59:13 -0500 Subject: [PATCH] wip: try to fix pathing --- packages/desktop/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/desktop/src/lib.rs b/packages/desktop/src/lib.rs index 5f47a5d6e..bcc8d1b82 100644 --- a/packages/desktop/src/lib.rs +++ b/packages/desktop/src/lib.rs @@ -340,11 +340,13 @@ impl DesktopController { .with_custom_protocol("wry".into(), move |request| { let path = request.uri().replace("wry://", ""); let (data, meta) = match path.as_str() { - "index.html" => (include_bytes!("./index.html").to_vec(), "text/html"), + "index.html" | "index.html/" | "/index.html" => { + (include_bytes!("./index.html").to_vec(), "text/html") + } "index.html/index.js" => { (include_bytes!("./index.js").to_vec(), "text/javascript") } - _ => unimplemented!("path {}", path), + _ => (include_bytes!("./index.html").to_vec(), "text/html"), }; wry::http::ResponseBuilder::new().mimetype(meta).body(data)