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