From 800c2e5360093082671ce3ff6d9ddb65b811b98e Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Sun, 4 Jan 2026 22:52:06 +0000 Subject: [PATCH] feat(m/direct)!: make links case-insensitive Change-Id: prroxtvotrzntrvnnwyvxnsmkznvvsxs 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 --- menu/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/menu/src/main.rs b/menu/src/main.rs index bc797688..0b5d70c3 100644 --- a/menu/src/main.rs +++ b/menu/src/main.rs @@ -50,7 +50,7 @@ fn clean_host(provided_host: &str) -> &str { } async fn get_redirect(default_location: &str, go: &str) -> Redirect { - let redirect = sqlx::query!(r#"SELECT ("to") FROM direct WHERE "from" = $1 LIMIT 1"#, go) + let redirect = sqlx::query!(r#"SELECT ("to") FROM direct WHERE "from" = $1 LIMIT 1"#, go.to_lowercase()) .fetch_one( STATE .get() @@ -134,7 +134,7 @@ async fn handle_create_post(headers: HeaderMap, Form(create): Form) -> R let create_call = sqlx::query!( r#"INSERT INTO direct ("from", "to", "owner") VALUES ($1, $2, $3)"#, - create.from, + create.from.to_lowercase(), create.to, owner, ) -- 2.43.0