From d4831a672a938bfae86b552423de9ad841866ded Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 13 Dec 2024 00:59:49 +0100 Subject: [PATCH] controllers/helpers/pagination: Remove generic parameter from `is_useragent_or_ip_blocked()` fn (#10191) --- src/controllers/helpers/pagination.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/controllers/helpers/pagination.rs b/src/controllers/helpers/pagination.rs index aa00409854..2565aa8821 100644 --- a/src/controllers/helpers/pagination.rs +++ b/src/controllers/helpers/pagination.rs @@ -1,5 +1,4 @@ use crate::config::Server; -use crate::controllers::util::RequestPartsExt; use crate::middleware::app::RequestApp; use crate::middleware::log_request::RequestLogExt; use crate::middleware::real_ip::RealIp; @@ -317,9 +316,9 @@ impl RawSeekPayload { /// /// A request can be blocked if either the User Agent is on the User Agent block list or if the client /// IP is on the CIDR block list. -fn is_useragent_or_ip_blocked(config: &Server, req: &T) -> bool { - let user_agent = req.headers().get_str_or_default(header::USER_AGENT); - let client_ip = req.extensions().get::(); +fn is_useragent_or_ip_blocked(config: &Server, req: &Parts) -> bool { + let user_agent = req.headers.get_str_or_default(header::USER_AGENT); + let client_ip = req.extensions.get::(); // check if user agent is blocked if config