Skip to main content

hostname_is_at_or_below

Function hostname_is_at_or_below 

Source
pub fn hostname_is_at_or_below(host: &str, ancestor: &str) -> bool
Expand description

Whether host is ancestor or a subdomain of it.

Compares DNS labels from the right, case-insensitively. Label boundaries are the point: evilfoo.bar shares a suffix with foo.bar but no label alignment, and foo.bar.attacker.com contains foo.bar but is below attacker.com. Both are false here.