]> Untitled Git - lemmy.git/blobdiff - crates/websocket/src/chat_server.rs
Adding a captcha rate limit. Fixes #1755 (#1941)
[lemmy.git] / crates / websocket / src / chat_server.rs
index 9fa258ff4fed6039e83b73295b2a998b4a9bd163..2b58b2c1effd03818ca54b1d5e6bc23a3eb24fd1 100644 (file)
@@ -491,7 +491,10 @@ impl ChatServer {
       } else {
         let user_operation = UserOperation::from_str(op)?;
         let fut = (message_handler)(context, msg.id, user_operation.clone(), data);
-        rate_limiter.message().wrap(ip, fut).await
+        match user_operation {
+          UserOperation::GetCaptcha => rate_limiter.post().wrap(ip, fut).await,
+          _ => rate_limiter.message().wrap(ip, fut).await,
+        }
       }
     }
   }