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

fix(m): encode default paths #178

merged opened by a.starrysky.fyi targeting main from private/minion/push-smklqylmuplo

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

Labels

None yet.

requested-reviewers

None yet.

tested-working

None yet.

rejected

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:uuyqs6y3pwtbteet4swt5i5y/sh.tangled.repo.pull/3md43bs53bp22
+10 -2
Diff #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]

History

4 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
fix(m): encode default paths
5/5 success
expand
expand 0 comments
pull request successfully merged
1 commit
expand
fix(m): encode default paths
5/5 success
expand
expand 0 comments
1 commit
expand
fix(m): encode default paths
5/5 success
expand
expand 0 comments
1 commit
expand
fix(m): encode default paths
5/5 success
expand
expand 0 comments