Permit private IPv6 while redacting responses

This commit is contained in:
ms2k 2026-07-17 03:45:13 +09:00
commit 5cbb0364d2
2 changed files with 47 additions and 3 deletions

View file

@ -163,7 +163,12 @@ fn is_metadata_capable_space(address: IpAddr) -> bool {
|| (first == 169 && second == 254)
|| (first == 192 && second == 0 && third == 0)
}
IpAddr::V6(address) => address.segments()[0] & 0xfe00 == 0xfc00,
IpAddr::V6(address) => {
let segments = address.segments();
(segments[0] == 0xfd00 && segments[1] == 0x0ec2)
|| (segments[0] == 0xfd20 && segments[1] == 0x00ce)
|| (segments[..4] == [0xfd00, 0x0db8, 0xdeca, 0xdeed])
}
}
}

View file

@ -32,12 +32,20 @@ pub struct OutboundRequest {
credential_headers: HeaderMap,
}
#[derive(Debug)]
pub struct OutboundResponse {
final_url: CanonicalUrl,
response: reqwest::Response,
}
impl fmt::Debug for OutboundResponse {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter
.debug_struct("OutboundResponse")
.field("status", &self.response.status())
.finish_non_exhaustive()
}
}
impl<R: Resolver> OutboundClient<R> {
#[must_use]
pub fn builder(resolver: R, policy: OutboundPolicy) -> OutboundClientBuilder<R> {