Skip to main content

check_ip_not_private

Function check_ip_not_private 

Source
pub fn check_ip_not_private(ip: IpAddr, context: &str) -> Result<(), SsrfError>
Expand description

Reject an IP that targets private, loopback, link-local, CGNAT, ULA, IPv4-mapped-private, IPv4-compatible, transition-mechanism, reserved, multicast, or broadcast space. context is a non-secret label (redacted URL or bare host) used only to build the error message.

ยงErrors

Returns SsrfError::Blocked when ip falls in any blocked range.