switch to taking a HeaderMap instead of Request

This commit is contained in:
Robin Appelman 2024-11-29 19:08:10 +01:00
commit d2cd67f9e5
2 changed files with 8 additions and 9 deletions

View file

@ -20,6 +20,6 @@ let request = Request::builder().header("x-forwarded-for", "192.0.2.1").body(())
let trusted_proxies = [
IpAddr::from([10, 0, 0, 1]).into(),
];
let client_ip = real_ip(&request, incoming_ip, &trusted_proxies);
let client_ip = real_ip(request.headers(), incoming_ip, &trusted_proxies);
assert_eq!(Some(IpAddr::from([192, 0, 2, 1])), client_ip);
```