Changing to post rate limit.

captcha_rate_limit
Dessalines 2021-11-23 09:38:52 -05:00
parent 26bd4083e0
commit e0bf2448e6
2 changed files with 2 additions and 2 deletions

View File

@ -492,7 +492,7 @@ impl ChatServer {
let user_operation = UserOperation::from_str(op)?; let user_operation = UserOperation::from_str(op)?;
let fut = (message_handler)(context, msg.id, user_operation.clone(), data); let fut = (message_handler)(context, msg.id, user_operation.clone(), data);
match user_operation { match user_operation {
UserOperation::GetCaptcha => rate_limiter.image().wrap(ip, fut).await, UserOperation::GetCaptcha => rate_limiter.post().wrap(ip, fut).await,
_ => rate_limiter.message().wrap(ip, fut).await, _ => rate_limiter.message().wrap(ip, fut).await,
} }
} }

View File

@ -159,7 +159,7 @@ pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimit) {
.service( .service(
// Handle captcha separately // Handle captcha separately
web::resource("/user/get_captcha") web::resource("/user/get_captcha")
.wrap(rate_limit.image()) .wrap(rate_limit.post())
.route(web::get().to(route_get::<GetCaptcha>)), .route(web::get().to(route_get::<GetCaptcha>)),
) )
// User actions // User actions