Fix cargo clippy issue
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:
@@ -84,9 +84,9 @@ fn get_remote_ip(req: &HttpRequest, args: &Args) -> String {
|
|||||||
let mut ip = req.peer_addr().unwrap().ip().to_string();
|
let mut ip = req.peer_addr().unwrap().ip().to_string();
|
||||||
|
|
||||||
// We check if the request comes from a trusted reverse proxy
|
// We check if the request comes from a trusted reverse proxy
|
||||||
if let Some(proxy) = args.proxy_ip.as_ref() {
|
if let Some(proxy) = args.proxy_ip.as_ref()
|
||||||
if match_ip(proxy, &ip) {
|
&& match_ip(proxy, &ip)
|
||||||
if let Some(header) = req.headers().get("X-Forwarded-For") {
|
&& let Some(header) = req.headers().get("X-Forwarded-For") {
|
||||||
let header: Vec<String> = header
|
let header: Vec<String> = header
|
||||||
.to_str()
|
.to_str()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
@@ -98,8 +98,6 @@ fn get_remote_ip(req: &HttpRequest, args: &Args) -> String {
|
|||||||
ip = header[0].to_string();
|
ip = header[0].to_string();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ip
|
ip
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user