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