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 } 51 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) 54 .fetch_one( 55 STATE 56 .get() ··· 134 135 let create_call = sqlx::query!( 136 r#"INSERT INTO direct ("from", "to", "owner") VALUES ($1, $2, $3)"#, 137 - create.from, 138 create.to, 139 owner, 140 )
··· 50 } 51 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.to_lowercase()) 54 .fetch_one( 55 STATE 56 .get() ··· 134 135 let create_call = sqlx::query!( 136 r#"INSERT INTO direct ("from", "to", "owner") VALUES ($1, $2, $3)"#, 137 + create.from.to_lowercase(), 138 create.to, 139 owner, 140 )