From b59e19de1b91e6336de31a0d5a6646a8599dc681 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 21 Nov 2024 14:47:31 +0100 Subject: [PATCH] move rate limit --- src/api_routes_http.rs | 1 + src/lib.rs | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api_routes_http.rs b/src/api_routes_http.rs index 42979eb6f..b667132c2 100644 --- a/src/api_routes_http.rs +++ b/src/api_routes_http.rs @@ -162,6 +162,7 @@ use lemmy_utils::rate_limit::RateLimitCell; pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimitCell) { cfg.service( web::scope("/api/v4") + .wrap(rate_limit.message()) .route("/image_proxy", web::get().to(image_proxy)) // Site .service( diff --git a/src/lib.rs b/src/lib.rs index 4539c6094..319efd224 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -297,7 +297,6 @@ fn create_http_server( let server = HttpServer::new(move || { let cors_config = cors_config(&settings); let app = App::new() - .wrap(rate_limit_cell.message()) .wrap(middleware::Logger::new( // This is the default log format save for the usage of %{r}a over %a to guarantee to // record the client's (forwarded) IP and not the last peer address, since the latter is