Your one-stop-cake-shop for everything Freshly Baked has to offer

fix(m): encode default paths

Previously we were not properly encoding paths given to our default
redirects. This broke some characters in search, and possibly would've
allowed someone to do something nasty with a crafted golink

+10 -2
+10 -2
menu/src/main.rs
··· 132 132 } 133 133 134 134 async fn get_redirect_base(go: &str) -> Redirect { 135 - get_redirect("/_/create?from=", go).await 135 + get_redirect( 136 + "/_/create?from=", 137 + &utf8_percent_encode(go, NON_ALPHANUMERIC).to_string(), 138 + ) 139 + .await 136 140 } 137 141 138 142 async fn get_redirect_search(go: &str) -> Redirect { 139 - get_redirect("https://kagi.com/search?q=", go).await 143 + get_redirect( 144 + "https://kagi.com/search?q=", 145 + &utf8_percent_encode(go, NON_ALPHANUMERIC).to_string(), 146 + ) 147 + .await 140 148 } 141 149 142 150 #[axum::debug_handler]