mirror of https://github.com/LemmyNet/lemmy.git
Changing to post rate limit.
parent
26bd4083e0
commit
e0bf2448e6
|
@ -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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue