Skip to main content

is_loopback_host

Function is_loopback_host 

Source
pub fn is_loopback_host(host: &str) -> bool
Expand description

Reports whether a URL host is one of the three loopback names that admit plaintext HTTP.

CORE-OAS-003 spells the exception syntactically: localhost, 127.0.0.1, or [::1] and nothing else. A name that happens to resolve to a loopback address, and any other address in 127.0.0.0/8, does not qualify.