rate limiting bug again

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
ゆめ 2024-11-15 22:31:05 -06:00
parent 58bfea6643
commit 0a08ea64e5
No known key found for this signature in database

View file

@ -245,7 +245,7 @@ pub async fn rate_limit_middleware<S: Sandboxing + Send + Sync + 'static>(
)
.nth_back(state.config.rate_limit.max_x_forwarded_for as usize - 1)
.map(|addr| match addr {
IpAddr::V6(addr) => IpAddr::V6(addr & Ipv6Addr::from_bits(!0u128 << 64)),
IpAddr::V6(addr) => IpAddr::V6(addr & Ipv6Addr::from_bits(!0u128 >> 64)),
addr => addr,
})
} else {