mirror of
https://codeberg.org/slatian/service.echoip-slatecave.git
synced 2025-07-23 01:06:04 +02:00
Update to axum 0.7
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
use axum_client_ip::SecureClientIp;
|
||||
use axum::{
|
||||
body::Body,
|
||||
extract::Extension,
|
||||
http::{
|
||||
Request,
|
||||
@ -40,11 +41,11 @@ pub fn build_rate_limiting_state(
|
||||
Extension(arc_limiter)
|
||||
}
|
||||
|
||||
pub async fn rate_limit_middleware<B>(
|
||||
pub async fn rate_limit_middleware(
|
||||
SecureClientIp(address): SecureClientIp,
|
||||
Extension(arc_limiter): Extension<Arc<SimpleRateLimiter<IpAddr>>>,
|
||||
req: Request<B>,
|
||||
next: Next<B>
|
||||
req: Request<Body>,
|
||||
next: Next
|
||||
) -> Response {
|
||||
let limiter = Arc::clone(&arc_limiter);
|
||||
|
||||
|
Reference in New Issue
Block a user