mirror of
https://codeberg.org/icewind/real-ip.git
synced 2026-10-01 17:14:11 +02:00
switch to taking a HeaderMap instead of Request
This commit is contained in:
parent
6f3a1977bc
commit
d2cd67f9e5
2 changed files with 8 additions and 9 deletions
|
|
@ -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);
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue