]> Untitled Git - lemmy.git/commitdiff
make captcha case-insensitive
authorDavid Sterry <davesterry@gmail.com>
Mon, 5 Jul 2021 00:51:08 +0000 (17:51 -0700)
committerDavid Sterry <davesterry@gmail.com>
Mon, 5 Jul 2021 00:51:08 +0000 (17:51 -0700)
crates/websocket/src/handlers.rs

index 055129cd339744a1b0278554a8ec1983ddc44ee3..5c3a1735c958faa24277ee07e579f4f3f55e901c 100644 (file)
@@ -249,7 +249,7 @@ impl Handler<CheckCaptcha> for ChatServer {
     let check = self
       .captchas
       .iter()
-      .any(|r| r.uuid == msg.uuid && r.answer == msg.answer);
+      .any(|r| r.uuid == msg.uuid && r.answer.to_lowercase() == msg.answer.to_lowercase());
 
     // Remove this uuid so it can't be re-checked (Checks only work once)
     self.captchas.retain(|x| x.uuid != msg.uuid);