pub enum BlockedHostClass {
Loopback,
PrivateNetwork,
LinkLocalMetadata,
DisallowedScheme,
Malformed,
OtherReserved,
}Expand description
A coarse classification of why a host is blocked by the private-network
policy. The whole point of this enum is secret safety: it carries only a
fixed, low-cardinality category — never the URL, host, path, query, or
credentials. Surfacing class.label() in an error message therefore cannot
leak any caller-supplied data.
Shared by web_fetch and the browser tool so both name a blocked request
the same way.
Variants§
Loopback
Loopback (127.0.0.0/8, ::1, localhost, 0.0.0.0).
PrivateNetwork
RFC1918 / unique-local private ranges (10/8, 172.16/12, 192.168/16,
fc00::/7) and CGNAT shared space (100.64.0.0/10).
LinkLocalMetadata
Link-local, including the cloud metadata endpoint (169.254.0.0/16,
notably 169.254.169.254; fe80::/10; *.internal/metadata hostnames).
DisallowedScheme
A non-http(s) scheme (e.g. file:, ftp:, data:).
Malformed
Malformed URL or a URL with no host.
OtherReserved
Other reserved/blocked address (broadcast, documentation/TEST-NET ranges,
.local hostnames) that isn’t one of the more specific classes above.