From 1ae4fe20bd075ba9e394715a7d9a7a81c8a752fa Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 28 Mar 2022 14:21:02 -0400 Subject: [PATCH] Don't check rate limit twice. --- crates/websocket/src/chat_server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/websocket/src/chat_server.rs b/crates/websocket/src/chat_server.rs index d9de90dbe..4dafafd8e 100644 --- a/crates/websocket/src/chat_server.rs +++ b/crates/websocket/src/chat_server.rs @@ -485,7 +485,7 @@ impl ChatServer { UserOperationCrud::CreatePost => rate_limiter.post().check(ip), UserOperationCrud::CreateCommunity => rate_limiter.register().check(ip), UserOperationCrud::CreateComment => rate_limiter.comment().check(ip), - _ => rate_limiter.message().check(ip), + _ => true, }; let fut = (message_handler_crud)(context, msg.id, user_operation_crud, data); (passed, fut) @@ -493,7 +493,7 @@ impl ChatServer { let user_operation = UserOperation::from_str(op)?; let passed = match user_operation { UserOperation::GetCaptcha => rate_limiter.post().check(ip), - _ => rate_limiter.message().check(ip), + _ => true, }; let fut = (message_handler)(context, msg.id, user_operation, data); (passed, fut)