mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
Do not try to validate nip05 domains less than 4 characters long
This commit is contained in:
parent
191c7a792d
commit
56f458f119
@ -133,6 +133,10 @@ fn parse_dns_id(dns_id: &str) -> Result<(String, String), Error> {
|
||||
} else {
|
||||
let domain = parts.pop().unwrap();
|
||||
let user = parts.pop().unwrap();
|
||||
if domain.len() < 4 {
|
||||
// smallest non-TLD domain is like 't.co'
|
||||
return Err(Error::InvalidDnsId);
|
||||
}
|
||||
Ok((user.to_string(), domain.to_string()))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user