Format all code following migration to Rust edition 2024
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
use std::future::{ready, Ready};
|
||||
use std::future::{Ready, ready};
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::app_config::AppConfig;
|
||||
@ -8,8 +8,8 @@ use crate::extractors::auth_extractor::AuthExtractor;
|
||||
use actix_web::body::EitherBody;
|
||||
use actix_web::dev::Payload;
|
||||
use actix_web::{
|
||||
dev::{forward_ready, Service, ServiceRequest, ServiceResponse, Transform},
|
||||
Error, FromRequest, HttpResponse,
|
||||
dev::{Service, ServiceRequest, ServiceResponse, Transform, forward_ready},
|
||||
};
|
||||
use futures_util::future::LocalBoxFuture;
|
||||
|
||||
@ -68,7 +68,10 @@ where
|
||||
.unwrap();
|
||||
|
||||
if !AppConfig::get().is_allowed_ip(remote_ip.0) {
|
||||
log::error!("An attempt to access VirtWeb from an unauthorized network has been intercepted! {:?}", remote_ip);
|
||||
log::error!(
|
||||
"An attempt to access VirtWeb from an unauthorized network has been intercepted! {:?}",
|
||||
remote_ip
|
||||
);
|
||||
return Ok(req
|
||||
.into_response(
|
||||
HttpResponse::MethodNotAllowed()
|
||||
@ -86,8 +89,8 @@ where
|
||||
Ok(auth) => auth,
|
||||
Err(e) => {
|
||||
log::error!(
|
||||
"Failed to extract API authentication information from request! {e}"
|
||||
);
|
||||
"Failed to extract API authentication information from request! {e}"
|
||||
);
|
||||
return Ok(req
|
||||
.into_response(HttpResponse::PreconditionFailed().finish())
|
||||
.map_into_right_body());
|
||||
|
Reference in New Issue
Block a user