Skip to content

Commit 82689a8

Browse files
authored
Merge pull request #8588 from jolicode/feat/agent-real-ip-geo
Add real ip and geolocation headers to reverse proxy / agent proxy
2 parents 5e562e4 + d23e0bc commit 82689a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/http/trusted_proxies.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@ pub struct TrustedProxies(Vec<AnyIpCidr>);
88
impl TrustedProxies {
99
pub fn new_local() -> Self {
1010
Self(vec![
11+
// IPV4 Loopback
12+
AnyIpCidr::from_str("127.0.0.0/8").unwrap(),
13+
// IPV4 Private Networks
1114
AnyIpCidr::from_str("10.0.0.0/8").unwrap(),
1215
AnyIpCidr::from_str("172.16.0.0/12").unwrap(),
1316
AnyIpCidr::from_str("192.168.0.0/16").unwrap(),
17+
// IPV6 Loopback
18+
AnyIpCidr::from_str("::1/128").unwrap(),
19+
// IPV6 Private network
20+
AnyIpCidr::from_str("fd00::/8").unwrap(),
1421
])
1522
}
1623

0 commit comments

Comments
 (0)