Allow _ in Hostnames

These are perfectly fine and are relied on by BIP 353, so we need
to ensure we allow them.
This commit is contained in:
Matt Corallo 2024-09-30 18:03:12 +00:00
parent 75d20e5a5c
commit 829dc34d10

View file

@ -1496,8 +1496,7 @@ impl Hostname {
s.len() <= 255 &&
s.chars().all(|c|
c.is_ascii_alphanumeric() ||
c == '.' ||
c == '-'
c == '.' || c == '_' || c == '-'
)
}
}