We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bfe199c commit 75178ebCopy full SHA for 75178eb
src/key_extractor.rs
@@ -131,7 +131,10 @@ fn maybe_x_forwarded_for(headers: &HeaderMap) -> Option<IpAddr> {
131
headers
132
.get(X_FORWARDED_FOR)
133
.and_then(|hv| hv.to_str().ok())
134
- .and_then(|s| s.split(',').find_map(|s| s.trim().parse::<IpAddr>().ok()))
+ .and_then(|s| {
135
+ s.split(',')
136
+ .find_map(|s| s.trim().split(':').next()?.parse::<IpAddr>().ok())
137
+ })
138
}
139
140
/// Tries to parse the `x-real-ip` header
0 commit comments