feat(m/direct)!: make links case-insensitive #149

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

It's not good if our links are case sensitive as different capitalizations aren't that distinct really. It's still important to make sure we don't mess up capitalization in the UI or when forwarding to search engines/etc., though

BREAKING-CHANGE: If you're using links that were made with capitals, those links will stop working

Changed files
+2 -2
menu
src
+2 -2
menu/src/main.rs
··· 50 50 } 51 51 52 52 async fn get_redirect(default_location: &str, go: &str) -> Redirect { 53 - let redirect = sqlx::query!(r#"SELECT ("to") FROM direct WHERE "from" = $1 LIMIT 1"#, go) 53 + let redirect = sqlx::query!(r#"SELECT ("to") FROM direct WHERE "from" = $1 LIMIT 1"#, go.to_lowercase()) 54 54 .fetch_one( 55 55 STATE 56 56 .get() ··· 134 134 135 135 let create_call = sqlx::query!( 136 136 r#"INSERT INTO direct ("from", "to", "owner") VALUES ($1, $2, $3)"#, 137 - create.from, 137 + create.from.to_lowercase(), 138 138 create.to, 139 139 owner, 140 140 )