diff --git a/.gitignore b/.gitignore index 881fcdc..0b4d356 100644 --- a/.gitignore +++ b/.gitignore @@ -146,3 +146,5 @@ dist .yarn/install-state.gz .pnp.* +# Cloudflare +.wrangler/ diff --git a/src/routes.rs b/src/routes.rs index d3452a6..54744b4 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -1,5 +1,6 @@ use html_escape::encode_safe; use html_minifier::minify; +use percent_encoding::{percent_encode, utf8_percent_encode, NON_ALPHANUMERIC}; use serde::{Deserialize, Serialize}; use serde_json::json; use sqids::Sqids; @@ -122,6 +123,8 @@ pub async fn handle_redirect(req: Request, ctx: RouteContext) -> worker::R .as_str() .replace(sqid, format!("app/{}", sqid).as_str()); + let mini_app_url = utf8_percent_encode(&mini_app_url, NON_ALPHANUMERIC).to_string(); + let html_doc = format!( r#"