Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
flaneur2020 committed Apr 10, 2024
1 parent 30be8f1 commit 804631a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/query/service/src/servers/http/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ fn get_client_ip(req: &Request) -> Option<String> {
if let Ok(ip_str) = value.to_str() {
let mut ip_str = ip_str.to_string();
if header == "X-Forwarded-For" {
ip_str = ip_str.split(',')[0];
ip_str = ip_str.split(',').next().unwrap_or("".to_string());
}
return Some(ip_str);
}
Expand Down

0 comments on commit 804631a

Please sign in to comment.